Switch
Switch
Easy to use for everyone
A switch is selected or unselected using the space bar key when focused.
Additional I/O visuals have been added to assist the understanding of which state of the switch means 'on' and which means 'off'.
High contrast colours have been used to emphasise the difference between 'on' and 'off' states. The conventional positioning of a switch's handle on the right-hand side also denotes the 'on' state.
For Assistive Technology
Switches use the ARIAswitch
role so that the change of state is announced by screen readers.
Based on
The switch component has been based on the following resources:
-
-
-
On Designing and Building Toggle Switches -
Toggle-Switch Guidelines -
Updated Switch script & more -
-
Switch Component: Toggle Button
Testing
We've tested this component against WCAG 2.2 Level AA. It's been tested with NVDA and VoiceOver, and several different users with different interaction methods.