Button
A button reacts the moment you press it, and its label names the action it runs.
When to use
Section titled “When to use”- Use one
filledbutton per view, for the main action: “Start task”, “Connect”, “Send”. - Use
lightfor a second action next to it. Useoutlinefor neutral actions in toolbars. Usesubtlefor the least important actions and for inline actions. Usedanger(filled or outline) for actions that destroy something. - Do not use a button to go somewhere. A link to another page is an anchor, styled as
subtleor as plain text.
What the consumer provides
Section titled “What the consumer provides”children: a verb phrase in sentence case. Never “OK”, “Submit” or “Yes”. The label tells people what will happen before they press.variant:filled | light | outline | subtle | danger | danger-outline.size:sm | md | lg(32, 40, 48px).leftSection: an icon aticon-md, oricon-smon asmbutton.loading: the draw caret replaces the icon. The button setsaria-busy, keeps its width and ignores clicks.disabled: rendersaria-disabled, so the button stays focusable. It sits inside aTooltipthat says why it is off.fullWidth: use it on phones, in action rows and in modals.
Behaviour
Section titled “Behaviour”- Hover shows
emerald-hover(120ms). Press showsemerald-activeand scales the button to 0.98. Focus shows thefocusring. - After an async action (one that waits for the server), show the result. Use a
Notificationor an inlinesuccessmessage. Never drop back to idle in silence: a person who started a task needs to know it started. - Icons go on the left only. The send button is the one exception: it is the caret alone, in an
ActionIcon.
Tokens
Section titled “Tokens”emerald-deep, emerald-hover, emerald-active, ink-on-brand, emerald-soft, surface-hover, border-strong, danger, danger-soft, surface-200, ink-disabled, radius-md (radius-sm at sm), control-sm|md|lg.
Mantine
Section titled “Mantine”<Button variant="filled" size="md" leftSection={<Icon/>} loading loaderProps={{ children: <CaretLoader/> }}>. danger is color="danger". danger-outline is variant="outline" color="danger".
- Two filled buttons side by side.
- A loading label that makes the button change width.
- Colour alone to mean danger. The label says “Delete”.