Playground
Variant
Size
Loading
Disabled
Leading icon
Trailing icon
Variants
Primary
The one action a screen wants taken. Solid action-primary fill.
Secondary
A distinct but lower-emphasis action. Outlined in action-secondary, never filled — keeps the amber accent rare.
Ghost
Lowest emphasis. No border at rest; background/secondary on hover.
Danger
Destructive actions only. Solid action-danger fill — a dedicated token, not the feedback-danger tint used for text/badges.
Sizes
Icons
Icons are hidden automatically while loading — the spinner takes the leading slot instead.
States
Hover and keyboard-focus any button above to see those states live.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | "primary" | "secondary" | "ghost" | "danger" | "primary" | Visual emphasis level. |
| size | "sm" | "md" | "md" | Padding and type size. |
| loading | boolean | false | Shows a spinner and disables interaction. Hides leadingIcon/trailingIcon while active. |
| disabled | boolean | false | Standard HTML disabled state. |
| leadingIcon | ReactNode | — | Icon rendered before the label, sized to match the button's type scale. |
| trailingIcon | ReactNode | — | Icon rendered after the label. |
| children | ReactNode | — | Button label. |
| ...rest | ButtonHTMLAttributes | — | onClick, type, aria-*, and any other native button prop. |
Usage Guidelines
When to use
- Use Primary for the single most important action on a screen — the one thing you want a user to do.
- Use Ghost for low-emphasis actions inside toolbars or tight, repeated UI where a bordered button would add visual noise.
- Use Danger only for destructive, hard-to-undo actions (delete, remove, revoke) — pair with a confirmation step, don't rely on color alone.
- Use loading to disable interaction and show progress during an async action rather than letting a user click twice.
When not to use
- Don't use two Primary buttons on the same surface — it defeats the point of having one clear action.
- Don't use a Button to navigate to another page or route — use a real link so it behaves correctly (right-click, open in new tab, browser back/forward).
- Don't rely on color alone to signal Secondary vs Ghost — the border does that; don't remove it in custom styling.
- Don't use Danger for merely negative-sounding actions ("Cancel", "Decline") that aren't actually destructive — reserve it for things that delete or revoke.