Button
A control that performs an action in place, such as submitting a form or opening a dialog, without changing the URL.
Anatomy
States
accent
neutral
transparent
danger
disabledProps
| Prop | Type | Default | Options |
|---|---|---|---|
variant | enum | "neutral" | |
size | enum | "md" | |
shape | enum | — | |
icon | IconName | — | — |
trailingIcon | IconName | — | — |
children | ReactNode | — | — |
disabled | boolean | false | — |
type | 'button' | 'submit' | 'reset' | "button" | — |
aria-label | string | — | — |
onClick | MouseEventHandler<HTMLButtonElement> | — | — |
Tokens
| State | Tokens |
|---|---|
| Default | |
size="sm" | |
size="md" | |
size="lg" | |
shape | |
shape="round" | |
| Default | |
| hover | |
| active | |
| disabled | |
| Default | |
| hover | |
| active | |
| disabled | |
| Default | |
| hover | |
| active | |
| disabled | |
| Default | |
| hover | |
| active | |
| disabled | |
| Default | |
size="sm" | |
| No tokens of its own; inherits from Root. | |
| Default | |
size="sm" | |
token.name- Token this component sets
token.name- Token from the component the part is built on; hover it for which
value- Raw value with no token; hover it for the reason
Every component follows ADR-025, ADR-026 and ADR-028(states, prop vocabulary, focus indicator); they are not repeated per component.