Theme
Button
A button. Pressing works the same with mouse, touch, keyboard and screen readers.
Examples
Props
Button
A button. Pressing works with mouse, touch, keyboard and screen readers alike.
| Prop | Type | Default | Description |
|---|---|---|---|
variant? | ButtonVariant | "secondary" | primary for the one main action, secondary for the rest, quiet in toolbars, danger to destroy. |
size? | "sm" | "md" | "md" | |
children | ReactNode | — |
Also takes 110 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 | Presses the button |
| Tab | Moves focus to the next control |
Accessibility
- A real button element; disabled buttons are announced as unavailable.
- A pending button shows a spinner announced as status, and stays focusable.
- Every variant has a border, so its edge survives forced-colours mode.