Skip to content
Motion & statesMarkdown

States

Interactive states shift one step on the 12-step color scale instead of using opacity hacks. Layering uses six named z-index tokens from base (0) to toast (50).

Interactive state rules

StateStep / ruleStatic chip
Solid (default → hover → pressed)step 9 → 10 → 11
9 default10 hover11 pressed
Subtle (default → hover → pressed)step 3 → 4 → 5
3 default4 hover5 pressed
Selected2px border or step-shifted fillselected (2px)
Disabledstep 3 background, step 8 text (no opacity)disabled (3/8)
Focus ring2px width, 2px offset, var(--ring) (:focus-visible)focus ring

Keyboard focus sample

Tab to this control to inspect the 2px focus ring with 2px offset.

Keep disabled controls at step 3 background and step 8 text with full 1 opacity. Render focus rings on :focus-visible only so pointer clicks stay clean while keyboard focus remains unmistakable.

Z-index layering

LayerTailwindCSS varValueUse
basez-base--z-base0Default document flow
stickyz-sticky--z-sticky10Sticky headers, top bars, sidebars
dropdownz-dropdown--z-dropdown20Menus, select popups, comboboxes
overlayz-overlay--z-overlay30Backdrop dimmers and grid overlays
modalz-modal--z-modal40Dialogs, sheets, alert modals
toastz-toast--z-toast50Transient status notifications

Default Tailwind numeric z-* classes are blocked in theme.css so every overlay and popup uses a named layer token.

Usage

Apply state and layering tokens in Tailwind CSS or CSS:

<div className="relative z-dropdown rounded-md border border-border bg-popover p-2 text-popover-foreground shadow-lg">
  <button
    type="button"
    className="w-full rounded-sm px-3 py-2 text-left text-body transition-colors duration-100 ease-standard hover:bg-muted"
  >
    Menu action
  </button>
</div>
.interactive-control:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

.modal-layer {
  z-index: var(--z-modal);
}

Do and don't

Do: Shift scale steps and use named z-index layers
Use step 9→10→11 for solid fills, step 3→4→5 for subtle fills, step 3/8 for disabled, and z-base through z-toast for stacking.
Don't: Use opacity for disabled states or arbitrary z-index numbers
Do not apply opacity-50 to disabled controls or write z-50 and z-[999] because numeric z-index utilities are disabled.

Accessibility

  • Global :focus-visible styling renders a 2px solid --ring outline with a 2px offset so keyboard navigation works on every interactive element.
  • Disabled controls use step 3 background and step 8 text without opacity reduction, keeping state styling predictable across themes.

Rationale

Step-shifting states preserve calibrated surface separation in both dark and light modes, and six named z-index tiers prevent stacking-context wars.