Toggle button meets WCAG 2.2 level AA when used as described on these pages. It follows the Button (toggle button) pattern of the WAI-ARIA Authoring Practices.
Keyboard
| Key |
Action |
| Tab |
Moves focus to the toggle. |
| Enter or Space |
Turns it on or off. |
aria-pressed="true" or "false", read as “toggle button, pressed”.
- An on state shown by fill and border, not by colour alone.
What your team does
- Keep the same label in both states.
- Use a switch for a saved setting.
WCAG criteria
| Criterion |
Level |
How |
| 1.4.11 Non-text Contrast |
AA |
Bold border on the on state |
| 4.1.2 Name, Role, Value |
A |
aria-pressed |