Skip to content

Buttons

Buttons initiate actions and communicate their purpose through labels.

Usage

Use buttons to trigger an action. The labels describe what will happen when the user interacts with it, such as Add, Save, or Delete.

Buttons are categorized by visual weight and semantic meaning to convey the importance of the action and its potential consequences.

Semantic meaning

Buttons are defined by the type of action they represent:

  • Default buttons represent regular, non-destructive actions like submitting forms or saving changes.
  • Warning buttons signify actions that require extra caution (e.g. confirming risky decisions).
  • Danger buttons are used for destructive or irreversible actions (e.g. deleting data).

Visual weigth

Buttons can be primary, secondary, or tertiary, regardless of their semantic meaning (default, warning, or danger). Visual weight indicates the importance of the action:

  • Primary buttons highlight the main action of the page or task, guiding users to the most important action (e.g. Save or Delete).
  • Secondary buttons are less visually striking but still important (e.g. Cancel or Edit).
  • Tertiary buttons are for lower-priority actions that need to be noticeable but not distracting.

Categories

Buttons can have text or a combination of text and labels, or they can be purely icon-based. When the button contains only an icon, it adopts a circular shape.

The circular variant also includes a ghost button style. Ghost buttons are subtle and blend into the interface, used for low-priority or optional actions. They signal availability without drawing attention, ideal for less critical or contextual options.

A button link is a button styled as a link.

Despite its link-like appearance, its primary distinction lies in its function: Links, built with the <a> HTML element, are designed for navigation, whereas button links, created using the <button> HTML element, are intended to trigger actions. This distinction ensures correct semantics, accessibility, and behavior.

While visually similar to a tertiary button, button links work well in tight layouts or inline with text, where a regular button would be too bulky.

Button link comparisson

Best practices

  • Use only one primary button per page.
  • Ensure call-to-action labels are straightforward and concise.
  • Use single-line text for button labels; avoid multi-line text.
  • Use circular shapes for icon-only buttons.
  • When truncating text, ensure at least three characters of the content remain visible.
  • Use the loading button to indicate ongoing processes.

Except where otherwise noted, content on this site is licensed under MIT License.