Theme
Toggle button
A button that stays on or off.
Examples
Props
ToggleButton
A button that stays on or off, announced as pressed or not pressed.
| Prop | Type | Default | Description |
|---|---|---|---|
size? | "sm" | "md" | "md" | |
children | ReactNode | — |
Also takes 102 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 |
|---|---|
| Enter or Space | Toggles it |
Accessibility
- Announced as pressed or not pressed (aria-pressed).