Theme
Switch
An on/off setting that takes effect at once.
Examples
Props
Switch
An on/off setting that takes effect at once, unlike a checkbox submitted with a form.
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — |
Also takes 103 props it passes to the underlying React Aria component or element (events, ARIA attributes, state such as isDisabled), documented by React Aria.
Keyboard
| Key | Does |
|---|---|
| Space | Toggles it |
Accessibility
- Announced as a switch, on or off.
- The thumb moves toward the inline end, so it mirrors in right-to-left text.