Aster
Lesson 8 of 1416:24 · Intermediate

One button, nine states

A button is a contract. In this lesson we map every state it can enter, then decide which ones deserve a visual difference.

MVMara Voss

Video lesson: One button, nine states. 16:24 long. A full transcript is available below.

Focus must survive on any background. Test it on an image, not just on white.

02 · Hover is not focus4:12 / 16:24

A button is not a rectangle with a label. It is a small contract: what the system promises at rest, under the pointer, under the keyboard, and when the work is not done yet.

Key idea

Every state needs a job. If two states look the same, one of them is decoration.

The state matrix

Nine states, each answering a different question. The signal is the smallest change that makes the answer legible without relying on color alone.

StateQuestion
RestIs this actionable right now?
HoverIs the pointer over it?
FocusWhere is the keyboard?
PressedDid the press register?
DisabledWhy can't I use this?
LoadingIs the work happening?
SuccessDid it work?
DangerCan this be undone?
QuietIs this secondary?

Build order

  1. 1

    Name the action

    Primary, secondary or destructive. The color is the last decision, not the first.

  2. 2

    Design focus first

    A keyboard user should never have to guess where they are. Build the ring before the hover.

  3. 3

    Reserve space for async

    Loading must not move the layout. Keep the label width and swap only the leading icon.

  4. 4

    Test the edge

    Disabled, error and success are states, not afterthoughts. Write the copy before the styles.

tokens.css
:root {
  --action-bg: var(--surface-900);
  --action-fg: var(--surface-0);
  --action-bg-hover: var(--surface-800);
  --action-ring: var(--focus-ring);
}

.button[data-loading="true"] {
  cursor: progress;
  color: transparent;
  background-image: var(--action-bg);
}

Exercise · 15 min

Audit one button in your product. List every state it can enter, then delete the ones that do not change the user's next move.

Key takeaways

  • Every state answers a different question. If two states look identical, one of them is decoration.
  • Focus is a first-class state, not a hover variant.
  • Loading, success and error are layout decisions as much as color decisions.

Lesson resources