Add role="switch" to switches in example code?
See original GitHub issueI’ve just been reading this good article by @argyleink about building a switch component https://web.dev/building-a-switch-component/#overview
I see it uses role=switch
. Think this should be added to the Switch Bootstrap docs example code?
https://getbootstrap.com/docs/5.1/forms/checks-radios/#switches
Let me know, I’d be happy to open a PR for it.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top Results From Across the Web
ARIA: switch role - Accessibility - MDN Web Docs - Mozilla
Adding the switch role in ARIA. This simple example just creates a widget and assigns the ARIA switch role to it. The button...
Read more >Adding the switch role in ARIA - CodePen
<p><code>button[role="switch"][aria-pressed]</code> works, but unless I'm doing ... to need <code>aria-checked</code> to effectively communicate the state.
Read more >Building a switch component - web.dev
A foundational overview of how to build a responsive and accessible switch component.
Read more >Switch Role Support - Adrian Roselli
All this post cares about is what happens once you add the switch role. ... <div> <input type="checkbox" id="ck02s" role="switch"> <label ...
Read more >Bootstrap Toggle Switch - examples & tutorial
Basic example. A switch has the markup of a custom checkbox but uses the .form-switch class to render a toggle switch. Consider using...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
role="switch"
support has been quite flaky in the past, but things seem to have improved https://scottaohara.github.io/a11y_styled_form_controls/src/checkbox--switch/#affects_on_srit’s probably ok to add this now to our docs.
thanks for the feedback. This good then?