Design System

State reference ​

Every state, the property it owns and the token it uses. For the model, see Overview. For how to apply it, see Usage.

What each state owns ​

StatePropertyTokenNotes
RestThe surface the component sits on
Hoverbackground-colorsurface-hoverA wash where the surface carries data
Activebackground-imagefg-strong at 20%A wash over what is already there, so it composes with hover
Selectedvaries by surfacesee below
Currentvaries by surfacesee belowSame treatment as selected
Focusoutlineline-focus2px, applied on :focus-visible for the whole interface. Offset 2px, or 0 on a bordered input, or minus 2px inside a composite widget
Invalidborder-colorline-danger
Disabledopacityopacity-disabled0.6, multiplies whatever is beneath
Lockedcolor and an iconA lock glyph and its tooltip
Loadingthe contentA skeleton or a spinner
Read-onlynothingBehaviour only

The states drawn ​

rest
Send
hover
Send
active
Send
focus
Send
invalid
Send
disabled
Send

Selected, by surface ​

SurfaceIdentifierEmphasis
Tree rowline-selected, a leading edgefg-strong at 20%, as a wash
Tabline-selected, on the tab borderfg-secondary
Sidebar itemsurface-selectedfg-secondary
Table rowline-selected, a leading edgefg-strong at 20%, as a wash
Menu itemsurface-selectedfg-strong

Where the background is already carrying a stripe or a colour somebody set, identification moves to an edge, and a tab moves it to an edge as well, because its border sits on the boundary with the panel it opens. Where the background is free otherwise, it carries the selection itself.

Measured contrast ​

line-selected as an identifier, against the system surfaces a row can be:

Behind itLightDark
surface-page5.497.47
surface-subtle5.076.97
surface-raised4.586.21
surface-hover4.165.67
surface-selected3.815.17

Every case clears the 3 to 1 an identifier owes. A colour somebody set is outside that set and is not measured here, which is why a selected row carries the wash as well as the edge.

surface-selected on its own measures 1.44 against the page in both appearances. On a sidebar item and a menu item, where it is the identifier, the step up in text colour carries selection with it.

The wash ​

UseValue
Hover on a surface that carries datasurface-hover at 75%
Selected on a surface that carries datafg-strong at 20%

It is translucent, so whatever is underneath, including a colour somebody set, stays visible.

Timing ​

Duration
Hover, press, focusduration-state, 150ms

A state has to feel immediate. Anything longer reads as lag rather than as feedback. See Motion.

Read-only against disabled ​

ContrastFocusableSelectableSubmitted with a formMeans
Read-onlyFullYesYesYesYou may read this, not change it
DisabledDimmedNoNot on a form controlNoThis does not apply right now

What not to write ​

AvoidInstead
Two co-occurring states on one propertyGive each its own property
An opacity on anything but disabledThe property that state owns
Removing the focus outlineAn offset, if it sits wrong
select-none on a disabled row or panelLeave selection on, so it can be read and copied
A click handler on a plain containerA real control, or a role with a tab stop and key handling
Dimming a read-only fieldNothing. Read-only has no appearance