Components
Button
One clear action per region. Modifiers cover containment, outline, soft fill, flat, link and alert; utilities cover icons, sizes, shape and state.
Modifiers
States
With icons
Sizes
Usage
The one clear action in a region.
Do and don't
- Do. Use a specific label and pick one modifier per role; keep one contained action per region.
- Don't. Put two contained buttons in one section or use active for selection.
Variants
| Variant | Use |
|---|---|
| primary | Contained. The one affirmative action in a region. |
| outline | Bordered, almost no fill. Secondary actions on any surface. |
| secondary | Soft fill for actions that matter but do not lead. |
| tertiary | Alias kept for existing code. Use outline in new code. |
| ghost | Flat. Toolbars and row actions. |
| link | Underlined text for navigation inside a sentence. |
| destructive | Alert. Irreversible actions; pair with a confirmation. |
Sizes and shape
default is 36px, compact 28px. icon and icon-compact are square. Legacy sm/md/lg aliases still resolve. Corner style comes from the shape preference, so buttons follow the same sharp, rounded or pill hierarchy as every other control.
States
A press compresses the surface by 1px without shifting layout. loading shows the spinner and blocks repeat activation. active holds the pressed look only while a popup is open. Disabled buttons explain why in nearby text rather than relying on the dimmed fill. See States & Feedback.
Props
variant; one of the seven styles above.size; default, compact, icon or icon-compact.loading; blocks interaction while work is in flight.leadingIcon/trailingIcon; icon components from the slot map.asChild/render; render the styling on a link or another element.active; forces the pressed look for an open popup. Not for selected state.
Accessibility
Native <button> semantics are preserved, so Enter and Space activate it. Keep labels specific, for example Submit application rather than OK. An icon-only button needs an aria-label. Keep a 24px minimum target on dense surfaces and prefer the default step on touch layouts.
Related
Fills and text colors come from the Colors interaction tokens; labels use the Typography body role.