# States {#c8}

> Chapter 8 of the App Design Guide 3.0.0. Index: https://www.designguide.dev/llms.txt

A state is how a component looks and acts at one moment, such as waiting, empty, or wrong input. Size classes follow [chapter 5](https://www.designguide.dev/md/05-adapt-across-sizes.md), and Medium uses the Compact answer.

## State vocabulary and loading {#s8-1}

### 8.1 Design every state of each component  {#design-every-state-of-each-component}

Default

**Rule:** Design each component in all 12 states: default, hover, focus, pressed, selected, disabled, pending, invalid, empty, loading, error, success.

**Why:** A state you do not design is a state the code invents, and users notice those bugs.  **When not:** A component that cannot reach a state, such as a static label, needs no design for it.

- Draw the states next to each other on one sheet.
- Name each state with the same word in design and in code.

| State (12 in all) | What it means | Where to see it |
| --- | --- | --- |
| Default | Ready, untouched | Every component |
| Hover, focus, pressed | A pointer, a key, or a finger is on it | Buttons, rows, fields |
| Selected | Chosen from a set | Chips, tabs, rows |
| Disabled | Not available now | Buttons, controls |
| Pending | Working, result not yet known | Buttons, rows |
| Invalid | The input is wrong | Fields |
| Empty, loading | No data yet, or data on the way | Lists, screens |
| Error, success | The action failed or worked | Screens, banners, toasts |

**Picture:** Figure: A button in 3 states and 2 fields: focus and error.

### 8.2 Shape the skeleton like the final content  {#shape-the-skeleton-like-the-final-content}

Default

**Rule:** Show a loading skeleton shaped like the final content, and render the real labels first.

**Why:** The layout does not jump when data arrives, and real labels tell the person what is coming.  **When not:** A wait under 1 s needs no loader. A single value can use a small spinner.

- Keep the skeleton in the same place and size as the data.
- Show a skeleton for 1 to 10 s ([Rule 8.3](https://www.designguide.dev/r/keep-a-slow-action-in-place-and-busy.md)).
- Keep the header and back arrow on screen while the body loads.

**Picture:** Do: Labels are real. Gray blocks mark where the numbers will go. Don't: A spinner on a white page shows no shape and no labels.

**See:** [8.3 Keep a slow action in place and busy](https://www.designguide.dev/r/keep-a-slow-action-in-place-and-busy.md)

### 8.3 Keep a slow action in place and busy  {#keep-a-slow-action-in-place-and-busy}

Default

**Rule:** Keep a slow action on its screen, block repeat presses, show progress after 1 second, and stay open on failure.

**Why:** A second press can double the order. A closed screen hides the failure.  **When not:** An action that always finishes in under 1 s needs press feedback only.

- Give press feedback within 100 ms. From 1 s, show a spinner in the button.
- Over 10 s, show progress ([Rule 14.13](https://www.designguide.dev/r/match-loading-feedback-to-the-wait.md)).
- On failure, keep the input and show the error beside the button.

**Picture:** Flow: 1. Press Send order. 2. After 1 s, the button spins. 3. Over 10 s, explain the wait. 4. Stay open on failure.

**See:** [14.13 Match loading feedback to the wait](https://www.designguide.dev/r/match-loading-feedback-to-the-wait.md)

## Empty states {#s8-2}

### 8.4 Write the empty state as a next step  {#write-the-empty-state-as-a-next-step}

Default · Adapts

**Rule:** Write each empty state as a next step: say what is missing, name the fill rule if any, and add one action.

**Wide screen:** On a wide screen, center the empty state in its pane at a capped width, with one action. (Triggers: Width 840+)

**Why:** An empty screen is a decision point. "Nothing to show" gives the person nowhere to go.

- Name what is missing: "No workouts yet". Show any fill rule.
- Add one primary action when the person can create the item.
- Use a 2 to 4 word title, one line, and a verb.

**Picture:** Do: The empty state says what to do and sits centered. Don't: The empty state gives no reason and no next step.

### 8.5 Name the search in an empty result  {#name-the-search-in-an-empty-result}

Default

**Rule:** Show the searched text in an empty result, offer a way to widen it, and keep the field focused.

**Why:** The person can spot a typo in the echoed text and edit the search at once.

- Keep the search field in the same position as results change.
- Offer one change: "Clear filters" or "Search all files".

**Picture:** Do: The text searched is echoed, a fix is offered, and focus stays. Don't: A blank result does not echo the search or offer a fix.

## Errors, validation, and disabled controls {#s8-3}

### 8.6 Name the cause and the fix, in place  {#name-the-cause-and-the-fix-in-place}

Default

**Rule:** Show an error next to the thing that failed, and name the cause and the fix.

**Why:** A distant message makes the person search. A message that only says "failed" gives no fix.  **When not:** A failure of the whole screen, such as no connection, uses a banner.

- Put a field error under the field, with an icon.
- Write the words as in [Rule 9.5](https://www.designguide.dev/r/write-an-error-in-3-parts.md).
- Use a dialog only to block or confirm ([Rule 4.5](https://www.designguide.dev/r/choose-the-container-by-task-size.md)).

**Picture:** Do: The error sits under the field and the person fixes it there. Don't: A dialog holds the error and covers the form.

**See:** [9.5 Write an error in 3 parts](https://www.designguide.dev/r/write-an-error-in-3-parts.md), [4.5 Choose the container by task size](https://www.designguide.dev/r/choose-the-container-by-task-size.md)

### 8.7 Validate on submit and keep the input  {#validate-on-submit-and-keep-the-input}

Default

**Rule:** Validate when the person submits, focus the first error, and keep the invalid input visible and unchanged.

**Why:** An error while typing scolds an unfinished thought. A rewrite loses the original.  **When not:** Check a username or a code as the person types only when a check needs the full value.

- Show the error after a failed submit.
- Clear each error as soon as the value is valid.
- Never rewrite the person's text while they type.

**Picture:** Do: The typed text stays. The error shows a sample date. Don't: The app replaced the typed date, and the person's input is lost.

### 8.8 Explain a disabled control in visible text  {#explain-a-disabled-control-in-visible-text}

Hard

**Rule:** Say in visible text why a control is disabled, never only in a tooltip.

**Why:** A tooltip needs a hover, and a phone has none.

- Put the reason as a gray line next to the control.
- State what would enable it: "Pick a time to continue."
- Keep the reason in text that a screen reader reads.

**Picture:** Do: A gray line under the button says what to do. Don't: The button is gray and gives no reason.

## Pending, offline, and success {#s8-4}

### 8.9 Show a pending state with a stated duration  {#show-a-pending-state-with-a-stated-duration}

Default

**Rule:** Label a pending item "Pending" and give a time: a duration in minutes or hours, or a date for days.

**Why:** A status with no end causes repeat contacts. The stated time must match the real time.  **When not:** Use a progress bar when the system knows how far the work has run.

- Use one word for the state: Pending.
- Use the status words in [Rule 9.10](https://www.designguide.dev/r/name-a-status-with-one-fixed-word.md).
- Change the label when the state ends.

**Picture:** Do: Pending shows with a stated time in the helper line. Don't: Processing gives no time, so the person waits and wonders.

**See:** [9.10 Name a status with one fixed word](https://www.designguide.dev/r/name-a-status-with-one-fixed-word.md)

### 8.10 Show offline and partial data in place  {#show-offline-and-partial-data-in-place}

Default

**Rule:** When offline, show the last data and its age in a banner, and mark any section that failed to load.

**Why:** A blank screen looks like a broken app. Old data with a clear age is still useful.

- Say when the data was last updated.
- Keep reading available. Turn off only the actions that need a connection.
- Mark a section that failed to load and offer Try again.

**Picture:** Do: A banner states the data age. The last data still shows. Don't: A blank error hides the data the app already has.

## Undo, confirm, and selected {#s8-5}

### 8.11 Offer Undo, not a confirm, for reversible actions  {#offer-undo-not-a-confirm-for-reversible-actions}

Default

**Rule:** Do a reversible action at once and show a toast with Undo, not a question.

**Why:** A question before every action adds a step and trains people to press OK unread.  **When not:** Ask first when the action cannot be undone (see [Rule 8.12](https://www.designguide.dev/r/confirm-only-what-cannot-be-undone.md)).

- Keep the Undo toast at least 10 seconds ([Rule 6.16](https://www.designguide.dev/r/show-one-toast-at-a-time.md)).
- Do not take focus from the person's task.
- Show the shortcut, Ctrl or Cmd Z, beside Undo.

**Picture:** Do: Notes.pdf leaves the list at once. A toast offers Undo. Don't: The person must confirm an action that was easy to undo.

**See:** [8.12 Confirm only what cannot be undone](https://www.designguide.dev/r/confirm-only-what-cannot-be-undone.md), [6.16 Show one toast at a time](https://www.designguide.dev/r/show-one-toast-at-a-time.md)

### 8.12 Confirm only what cannot be undone  {#confirm-only-what-cannot-be-undone}

Hard

**Rule:** Ask for confirmation in a dialog only for an action that cannot be undone, and name the loss.

**Why:** A confirm gets weight when it is rare. Naming the loss makes the person stop and read.

- Put the object in the title: "Delete 2 files?".
- Say the loss in one line: "You cannot undo this."
- Name the choices "Keep files" and "Delete 2 files" ([9.12](https://www.designguide.dev/r/skip-are-you-sure-and-repeat-the-verb.md)).

**Picture:** Do: The title names the files. The text names the loss. Don't: The dialog names no object, and OK does not say what happens.

**See:** [9.12 Skip "Are you sure?" and repeat the verb](https://www.designguide.dev/r/skip-are-you-sure-and-repeat-the-verb.md)

## Lists, permissions, and sessions {#s8-6}

### 8.13 Load a long list in pages  {#load-a-long-list-in-pages}

Default · Adapts

**Rule:** Load a long list in pages, end it with a Load more button, and say how many items show.

**Wide screen:** On a wide screen, give a long table page controls with the range and the total, like 1 to 25 of 214. (Triggers: Width 840+, Dense data)

**Why:** Loading all items at once is slow. A count tells the person how much is left.  **When not:** A short list that fits one screen needs no paging.

- Keep the items already shown when the next page loads.
- Show a spinner in Load more; on failure offer Try again.
- Use continuous scroll for a feed. Use Load more for a list.

**Picture:** Size pair (Phone, 375; Window, 1280): The phone ends with Load more. The window shows page controls.

### 8.14 Explain a denied permission and offer a fix  {#explain-a-denied-permission-and-offer-a-fix}

Default

**Rule:** When a person denies a permission, say what stops working and how to change it in Settings or in the browser.

**Why:** A silent failure looks like a broken app. The person can fix a denied permission only if they know.  **When not:** Do not nag. Ask again only when the person uses the feature again.

- Keep the rest of the app usable.
- Name the feature that needs the permission.
- Offer one button to Settings, or name the browser setting.

**Picture:** Figure: The screen names the cause and offers one way on.

### 8.15 Keep the work when a session expires  {#keep-the-work-when-a-session-expires}

Default

**Rule:** When a session expires, keep the person's input, say what happened, and ask for sign-in on the same screen.

**Why:** Losing typed work is the cost people refuse to pay.

- Restore the screen after sign-in.
- Do not clear fields while the session is out.
- Say that the session ended, not that an error occurred.

**Picture:** Figure: The note stays on screen. One button restores the session.

### 8.16 Undo a failed instant change with a message  {#undo-a-failed-instant-change-with-a-message}

Default

**Rule:** Show an instant change at once, and on failure restore the old value and say why.

**Why:** A change that fails but stays on screen shows a false state.  **When not:** Use a pending state instead when a wrong guess would cause harm.

- Return the control to its old state.
- Name the cause in one banner line.
- Show the change within 100 ms, as in [Rule 14.5](https://www.designguide.dev/r/respond-to-every-press-within-100-ms.md).

**Picture:** Figure: The switch returns to Off and a message says why.

**See:** [14.5 Respond to every press within 100 ms](https://www.designguide.dev/r/respond-to-every-press-within-100-ms.md)

## Masks, search, and pending states {#s8-7}

### 8.17 Mask a sensitive value in place, everywhere  {#mask-a-sensitive-value-in-place-everywhere}

Default

**Rule:** Hide a sensitive value with a mask of the same size, in the same place, on every spot where it shows.

**Why:** A mask of the same size keeps the layout still. A partial mask leaves the fact readable below.  **When not:** Do not mask a value that the person must check before an action, such as a total.

- Put one switch next to the value, such as Hide weight.
- Mask the hero, the rows, and the charts with one switch.
- Remember the choice for the next visit.

**Picture:** Do: Every value is masked at the same size. Nothing moves. Don't: Only the hero is masked. The rows still show the value.

### 8.18 Show search and result without a spinner  {#show-search-and-result-without-a-spinner}

Default

**Rule:** Show a search for nearby things as a quiet screen around one center, then place the found item there.

**Why:** A quiet center shows that the app looks around. A spinner with "Searching" tells nothing.  **When not:** Skip the quiet screen when the result arrives in under 1 s. After 10 s, add a progress sign.

- Respond in 100 ms. Show the quiet screen after 1 s ([14.13](https://www.designguide.dev/r/match-loading-feedback-to-the-wait.md)).
- Place the found item at the center, with its name.
- Keep a visible Cancel while the app searches.

**Picture:** Do: After 1 s: a calm center and one line. Do: Found: the studio takes the center. Don't: A spinner and the word Searching tell nothing.

**See:** [14.13 Match loading feedback to the wait](https://www.designguide.dev/r/match-loading-feedback-to-the-wait.md)

### 8.19 Say who is waiting in a pending state  {#say-who-is-waiting-in-a-pending-state}

Default

**Rule:** In a pending state, say who is waiting and what can change, in plain words.

**Why:** A bare Pending chip leaves the person to guess. A reason lets them wait without a support call.  **When not:** Add a time as well when you know it (see [Rule 8.9](https://www.designguide.dev/r/show-a-pending-state-with-a-stated-duration.md)).

- Name the party that must act: the restaurant, the host.
- Say what can change: the total, the time, or the seat.
- Never write processing or a code.

**Before:** Pending (It gives no reason and no next step)

**After:** Pending: The restaurant is confirming your order. The total can change if an item is out of stock. (It names who waits and what can change)

**See:** [8.9 Show a pending state with a stated duration](https://www.designguide.dev/r/show-a-pending-state-with-a-stated-duration.md)

## Locks, modes, and zero {#s8-8}

### 8.20 Let a lock change the object itself  {#let-a-lock-change-the-object-itself}

Default

**Rule:** When an object locks, change how the object looks, not only the label of the button.

**Why:** A person sees a lock from a distance. A changed label alone leaves the object looking active.  **When not:** A rare, low-risk lock can change only the label and a small icon.

- Dim the object and add a lock icon at its center.
- Turn the button into its opposite: Lock slot, Unlock slot.
- Change the object in 300 ms or less ([Rule 4.14](https://www.designguide.dev/r/put-a-safety-control-on-the-object.md)).

**Picture:** Do: The slot itself looks locked. The button offers the opposite. Don't: The slot looks open, so the Unlock slot button makes no sense.

**See:** [4.14 Put a safety control on the object](https://www.designguide.dev/r/put-a-safety-control-on-the-object.md)

### 8.21 Show a mode with one shared sign  {#show-a-mode-with-one-shared-sign}

Default

**Rule:** Show an active mode with one shared sign in every place that the mode applies, not only in settings.

**Why:** A mode that shows in one place gets forgotten. One repeated sign shows that the rules changed.  **When not:** A mode that affects one screen only needs the sign on that screen.

- Pick one sign and use it everywhere.
- Add the mode name in words where there is room.
- Remove every sign when the mode ends.

**Picture:** Do: Today and History show the same sign for the mode. Don't: The mode shows only in Settings. Nothing here shows it.

### 8.22 Keep one layout from zero to done  {#keep-one-layout-from-zero-to-done}

Default

**Rule:** Keep the layout the same at zero, at part way, and at done, and let only the value and its caption change.

**Why:** A jump to a new screen at 100 percent moves the buttons. A fixed layout makes zero normal.  **When not:** A first run with no data can use an empty state (see [Rule 8.4](https://www.designguide.dev/r/write-the-empty-state-as-a-next-step.md)).

- Show the bar or ring in gray at zero.
- Keep the buttons in place at done.
- Show Goal reached as the caption, not as a new screen.

**Picture:** Figure: Zero: an empty bar. The button stays. Figure: Part way: the bar fills. The button stays. Figure: Done: a full bar. The button stays.

**See:** [8.4 Write the empty state as a next step](https://www.designguide.dev/r/write-the-empty-state-as-a-next-step.md)

## States for pointer and keyboard {#s8-9}

### 8.23 Show hover, keyboard focus, and pressed states  {#show-hover-keyboard-focus-and-pressed-states}

Default · Adapts

**Rule:** Give every control a hover fill, a double-ring keyboard focus ring, and a pressed state.

**Wide screen:** On a wide screen, hover adds a fill and quick actions, and the same actions also show on keyboard focus. (Triggers: Fine pointer, Keyboard, Hover)

**Why:** A pointer and a keyboard need their own signs. [Rule 8.1](https://www.designguide.dev/r/design-every-state-of-each-component.md) lists all 12 states.

- Hover fills a row or button, and is never the only path.
- Keyboard focus draws a two-tone ring, so it reads on any fill.
- Pressed is darker than hover and shows within 100 ms.

**Picture:** Size pair (Phone, 375; Window, 1280): The phone shows pressed and focus. The window adds hover.

**See:** [8.1 Design every state of each component](https://www.designguide.dev/r/design-every-state-of-each-component.md)

### 8.24 Mark selected, dragged, and drop-target by shape  {#mark-selected-dragged-and-drop-target-by-shape}

Default

**Rule:** Show a dragged item as a ghost, mark a drop target with a line or solid border, and count a multi-select.

**Why:** Color alone fails on a gray screen. A shape shows what moves and where it lands.

- Show a ghost of the dragged item at the pointer.
- Mark the drop place with a line or a solid border.
- Show a count when many items are selected: "3 selected".

**Picture:** Figure: The selected row has a fill and a check. A ghost shows the drag.

## States on a wide screen {#s8-10}

### 8.25 Fill an empty pane and an empty table  {#fill-an-empty-pane-and-an-empty-table}

Default · Adapts

**Rule:** Replace an empty list or table with the empty state, headers included.

**Wide screen:** On a wide screen, keep the list and show a prompt in the detail pane that says what to select. (Triggers: Width 840+)

**Why:** A blank pane looks broken. Headers over blank rows hide the reason for the gap.

- [Rule 5.13](https://www.designguide.dev/r/mark-the-selected-row-and-show-a-placeholder.md) holds the placeholder rule for an empty detail pane.
- Show the empty state in place of every blank row.

**Picture:** Do: The empty state replaces the whole list or table. Don't: Column headers sit over blank rows at both sizes. Figure: The empty detail pane says what to select.

**See:** [5.13 Mark the selected row and show a placeholder](https://www.designguide.dev/r/mark-the-selected-row-and-show-a-placeholder.md)

### 8.26 Load each part on its own  {#load-each-part-on-its-own}

Default · Adapts

**Rule:** Show a skeleton only where content loads, and keep the rest of the screen usable.

**Wide screen:** On a wide screen, give each pane its own skeleton, so a slow detail pane never blocks the list. (Triggers: Width 840+)

**Why:** One slow pane should not freeze the window. The person can work elsewhere.

- Shape each skeleton like its own content (see [Rule 8.2](https://www.designguide.dev/r/shape-the-skeleton-like-the-final-content.md)).
- Keep the other panes live while one loads.
- Pane layout: [Rule 5.15](https://www.designguide.dev/r/load-and-empty-each-pane-on-its-own.md).

**Picture:** Size pair (Phone, 375; Window, 1280): The phone keeps its header. Only the loading part shows a skeleton.

**See:** [8.2 Shape the skeleton like the final content](https://www.designguide.dev/r/shape-the-skeleton-like-the-final-content.md), [5.15 Load and empty each pane on its own](https://www.designguide.dev/r/load-and-empty-each-pane-on-its-own.md)

### 8.27 Show the connection state in one fixed place  {#show-the-connection-state-in-one-fixed-place}

Default · Adapts

**Rule:** Show the connection state in one fixed place, disable only controls that need the network, and say why.

**Wide screen:** On a wide screen, show the connection state in the status bar or the title bar, not as a repeated banner. (Triggers: Width 840+, Fine pointer)

**Why:** A state that moves or repeats is hard to trust. A fixed sign tells what still works.

- Keep reading and local work available.
- Put the reason in visible text (see [Rule 8.8](https://www.designguide.dev/r/explain-a-disabled-control-in-visible-text.md)).
- Data age and failed sections: [Rule 8.10](https://www.designguide.dev/r/show-offline-and-partial-data-in-place.md).

**Picture:** Size pair (Phone, 375; Window, 1280): The phone uses a banner. The window uses the status bar.

**See:** [8.8 Explain a disabled control in visible text](https://www.designguide.dev/r/explain-a-disabled-control-in-visible-text.md), [8.10 Show offline and partial data in place](https://www.designguide.dev/r/show-offline-and-partial-data-in-place.md)
