Skip to main content
  1. Docs
  2. Components
  3. 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

KeysWhat happens
TabTabMoves focus into the group; Tab again leaves it.
←→Moves between toggles; ↑ and ↓ when vertical. Mirrored in right to left.
HomeHomeEndEndMoves to the first or the last.
SpaceEnterPresses 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
Next — Toggle groupChangelog