Switch
Switch
is a component used to toggle between on and off states.
The Switch
follows the WAI-ARIA - Switch Pattern for accessibility.
Keyboard Navigation
Key | Description | State |
---|---|---|
Tab | Focuses on a switch that is not disabled. | - |
Space , Enter | Toggles the on/off state of the switch. | - |
ARIA Roles and Attributes
Component | Roles and Attributes | Usage |
---|---|---|
Switch | role="switch" | Indicates that it is a switch. |
aria-checked | Set to "true" if the switch is on, "false" if it is off. |
Edit this page on GitHub