DEV Community

Discussion on: Accessible Toggle

Collapse
 
jameslivesey profile image
James Livesey • Edited

Good point — that's definitely a thing to add to our library! Having tested our demo in a few screen readers, they seem to still be okay with using checkboxes' checked value with the role, but it's a good idea to add the extra attribute (with JS or course) for assistive technologies that aren't as good at detecting that. Thanks for the advice!

I would assume from the docs that the aria-checked attribute is used mainly so screen readers can tell the user when a checkbox changes state on its own (without interaction), which would make sense!