Skip to main content
  1. Docs
  2. Components
  3. Forms

Switch

A setting, on or off, applied at once. A setting that waits for Save is a Checkbox.

Import
@qeetrix/react
Status
StableSince 0.0.2
Renders
<span role="switch">Server-rendered
Tested
WCAG 2.2 AAaxe on every pull request

01

Keyboard

KeysWhat happens
SpaceSwitches it.
EnterSwitches it.
TabTabMoves to each switch in turn.

02

Behaviour

Role and name
role="switch" with aria-checked; named by its label.
Target
The whole row switches it.
Direction
The thumb moves to the end side, in left to right and right to left.
Forced colours
On draws 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
  • Every field shares one height and edge: a test checks them together
Next — SwitchChangelog