Actions
Buttons
Use one primary action per task, secondary and quiet buttons for supporting actions, and the danger variant for destructive actions.
Anatomy
- Button container
- Action label
Configuration
Variants
Use for the main action in a task.
Use for an alternative action alongside the primary one.
Use for a low-emphasis action.
Tone
Use the palette’s primary colour for a standard action.
Use the critical colour for a destructive action.
Size
Use the standard size for actions in forms and dialogs.
Use a compact button where space is limited.
State
The action is available.
Use when the action can’t run yet.
Show an operation in progress and prevent repeat activation.
Icon placement
A clear label is enough for most actions.
A leading icon can reinforce the action.
A trailing arrow can signal the next step.
Width
Let the label determine the width for an inline action.
Fill the available width when the action should span its container.
Design tokens used
| Category | Token | Value | Where it’s used |
|---|---|---|---|
| Colour | --cc-foreground | — | Secondary label and hover outline, and quiet label on hover |
--cc-muted-foreground | — | Quiet button label | |
--cc-surface | — | Secondary button background | |
--cc-surface-muted | — | Secondary and quiet button backgrounds on hover | |
--cc-border | — | Secondary button border | |
--cc-primary | — | Primary button background | |
--cc-primary-hover | — | Primary button background on hover | |
--cc-primary-foreground | — | Primary button label and icon | |
--cc-critical | — | Destructive button background | |
--cc-critical-hover | — | Destructive button background on hover | |
--cc-critical-foreground | — | Destructive button label | |
--cc-focus-ring | — | Keyboard focus ring |