Appearance
Button
Runs an action straight away.
base-basebutton--variantsOpen in Storybook ↗When to use
- Any action that happens when it is clicked: save, open, export, delete.
- Pick the variant by the role of the action on the screen, not by how prominent you want it to look.
When not to use
- One main action with alternatives: use a split button.
- Several secondary actions: put them in an overflow menu.
Variants
| Variant | Use for | Colour |
|---|---|---|
primary | the one action a screen leads with (Open record) | client accent; follows the client theme |
commit | writing a change (Save, confirm) | platform teal; never themed |
secondary | everything alongside (Cancel) — the default | white with a border |
ghost | dense toolbars and low-emphasis actions (Show more) | no border, muted ink |
danger | destructive actions (Delete) | red |
Two sizes: md (default) and sm, for toolbars, panel headers and menus.
Keep one primary or commit button per group of actions.
Anatomy
- Container: a rectangle.
secondaryuses--radius-input; the others use--radius-button. Padding comes from--button-md-paddingor--button-sm-padding. - Icon (optional): before the label,
--button-gapapart. An icon-only button uses--button-md-padding-iconor--button-sm-padding-icon. - Label: bold,
--text-button-mdor--text-button-sm, on one line. - Reason icon (optional): a help icon after the label on a disabled button; its tooltip says why the action is unavailable.
States
| State | What you see | Trigger |
|---|---|---|
| Resting | per variant | — |
| Hover | darker or washed fill; primary also gets an accent shadow | pointer |
| Focus | --focus-ring-width ring in --color-focus-ring | keyboard |
| Pressed | the button shrinks slightly | press |
| Loading | disabled look; a spinner replaces the icon (or covers the label) and the width stays the same | async action |
| Disabled | disabled ink on a neutral fill | action unavailable |
| Disabled with a reason | disabled look plus a help icon with a tooltip | action unavailable, with an explanation |
base-basebutton--statesOpen in Storybook ↗In narrow containers a button with an icon hides its label visually and keeps it as the accessible name, so it becomes icon-only. Buttons that must always show their label opt out of this.
Keyboard & accessibility
- It is a native
<button type="button">: Tab reaches it, Enter and Space run it. - Icon-only buttons need a name: a label (hidden visually) or an
aria-labelsuch as Edit field. - A disabled button is skipped by Tab.
- A disabled button with a reason stays reachable by Tab (
aria-disabled="true"), so keyboard and screen-reader users can find out why. Clicks do nothing. - A loading button is disabled and has
aria-busy="true".
base-basebutton--icon-onlyOpen in Storybook ↗Content
- Start with a verb, in sentence case: Save, Add person, Open record.
- Say what happens, not what the control is: Export, not Export button.
- Keep labels short; they never wrap.
- A disabled reason says what to do: Select at least one item first.