- Docs
- Components
- Actions
Toggle group
A row of toggles: one view among a few, or a set of tools that are each on or off.
- Import
- @qeetrix/react
- Status
- StableSince 0.0.2
- Renders
<div role="group">Server-rendered- Tested
- WCAG 2.2 AAaxe on every pull request
01
Keyboard
| Keys | What happens |
|---|---|
| TabTab | Moves focus into the group; Tab again leaves it. |
| ←→ | Moves between toggles; ↑ and ↓ when vertical. Mirrored in right to left. |
| HomeHomeEndEnd | Moves to the first or the last. |
| SpaceEnter | Presses the focused toggle. |
02
Behaviour
- Role and name
- role="group", named by its aria-label; each toggle a button with aria-pressed.
- One Tab stop
- Roving focus: the group is one stop in the page's tab order.
- Right to left
- The arrow keys follow the reading direction; tested in RTL.
- Pressed
- A fill, not colour alone; forced colours draw it in Highlight.
03
Tested
On every change, before it ships.
- axe, WCAG 2.2 A and AA, in Chromium on every pull request
- Firefox and WebKit every night
- Forced colours, reduced motion and right to left
- Server rendering