Skip to the page

UI

Buttons

A button does something when it's pressed.

In use

An icon button opens and closes the sidebar.
The primary button that closes the Filter panel.

Anatomy

  1. ContainerRounded 10px, at least 44px tall. An icon button is a 44px circle.
  2. LabelOutfit, 15px. A verb that says what happens.
  3. Icon, optional18px, before the label. An icon button has an icon and no label.

States

PrimaryA slightly lighter green on hover.
Rest
Hover
Focus
QuietThe background darkens one step on hover.
Rest
Hover
Focus
IconA soft circle appears on hover.
Rest
Hover
Focus

When to use it

Use a primary button for the one action that finishes a panel, and a quiet button for other actions. Use an icon button where there’s no room for a label.

When not to use it

Don’t use a button to ask a question; use a suggestion chip. A panel never has two primary buttons.

Accessibility

White text on Dugout green reaches 7.7:1 in light mode, and near-black text on the lighter dark-mode green reaches 5.4:1. Icon buttons have a name screen readers announce.

Tokens

In code: Button, with variant set to primary, quiet or icon, in src/ds/components/Button

Tokens
TokenWhat it sets
--ds-brandThe primary button's fill.
--ds-brand-hoverThe primary button's fill under the pointer.
--ds-brand-inkThe primary button's text.
--ds-surfaceA quiet or icon button under the pointer.
--ds-radius-smThe corners.
--ds-touch-targetThe 44px minimum height.