// ToggleRow.js
...
<label className={styles.toggle} tabIndex='0' onKeyDown={e => handleToggle(e)}>
<input
className={styles.toggleInput}
type='checkbox'
checked={active}
onChange={() => setActive(!active)}
tabIndex='-1'
aria-labelledby={'toggle_' + index}
aria-checked={active} // pass state to an aria-checked attribute on the input
/>
<span className={styles.toggleSlider}></span>
</label>
...
view raw ToggleRow.js hosted with ❤ by GitHub