Components
Switch
Switch gives users a choice between two alternatives. The switch can either be turned off or on and must always be set with a default choice.
We are working to improve the accessibility documentation for this component. If you have questions or see something that should be prioritised, please contact us on Github or Slack.
We use role="switch" to inform screen readers that this is a toggle switch. This allows screen readers to tell the user that it is a switch and that it can be turned on and off. We do not add aria-checked because it is not necessary when the switch is an input with type="checkbox". 1
Keyboard navigation
- Space toggles the switch on and off