Skip to main content
  1. Docs
  2. Components
  3. Actions

Button

An action. One solid and one soft per region; everything else ghost.

Import
@qeetrix/react
Status
StableSince 0.0.2
Renders
<button>Server-rendered
Tested
WCAG 2.2 AAaxe on every pull request

01

When to use

Use it for
  • Doing something here: saving, creating, confirming.
  • Opening a dialog, menu or drawer.
  • The one main action of a form, card or dialog.
Not for
  • Going to another pageLink
  • An action shown only as an iconIcon button
  • Turning a setting on or offSwitch
  • A pressed or not-pressed stateToggle

02

Anatomy

  1. 1button<button>The root: a native button, type="button".
  2. 2button-label<span>Leads. A verb.
  3. 3button-zone<span>Trails, behind a 1px rule. Only with an icon, or while loading.
  4. 4button-icon<svg>Sharp. 16px; 20px at lg.

03

Do and don't

One solid, one soft
DoOne solid and one soft in a region; the rest ghost.
Don'tThree solids: nothing leads.
A verb for a label
DoSay what happens.
Don't"OK" and "Submit" say nothing.
The icon trails
DoPass it as icon: it trails, in its zone.
Don'tAn icon before the label.
Confirm what can't be undone
DoThe danger action alone, in a dialog that asks.
Don'tDanger beside the primary, one slip away.
Links go places
DoGoing somewhere is a link.
Don'tA button that only navigates.

04

Sizes

Each height follows the region's density.

SizeHeight: compact / default / comfortableBefore the labelIconType
sm24 / 28 / 3210px16pxlabel.sm
md28 / 32 / 3614px16pxlabel.md
lg32 / 40 / 4416px20pxlabel.md

05

Content

  • A verb: "Create invoice", "Invite users".
  • Sentence case, no full stop.
  • Two or three words; never "OK" or "Submit".
Next — ButtonAPI