# Empty and loading states

What a page, section or cell shows when it has nothing yet, and while its content is on the way.

## When it applies

- A page, tab or section has nothing in it yet, or a search matches nothing.
- One value is missing, like a contact with no phone number.
- Content is loading, or one control is busy. No example screen shows loading yet.

## Components

- [Empty State](../components/empty-state.md): A whole page, tab or section with nothing in it.
- [Empty Value](../components/empty-value.md): One missing value in a cell or detail row.
- [Skeleton](../components/skeleton.md): A list or panel loading its content.
- [Spinner](../components/spinner.md): A short wait that stands alone.
- [Button](../components/button.md): Its own `loading`, for a wait on one action.

## Rules

- Do: Write an `EmptyState`'s `title` as what's missing, like "No tasks yet", and its `description` as one sentence on what will appear. Give it at most one `action`.
- Do: Match the layout to the space: `line` under a section header that already carries Add, `inline` for an empty tab, and `stacked` for a whole page with room.
- Do: Use `EmptyValue` in every empty table cell and detail row, with a `label` when "Empty" is not specific enough, like "No referrer".
- Do: Build a `Skeleton` to the content's shape and wrap it in `SkeletonSwap`, so the loaded content fades in where the skeleton was and the region is marked busy.
- Do: For a wait on one action, return a Promise from the button's `onClick`, or set `loading`. The button turns its icon into the spinner and back.
- Don't: Write "Nothing here", "No data", "N/A" or "None", or leave a cell blank. A blank cell reads as still loading or broken.
- Don't: Use a `Spinner` while a list or panel loads. Use `Skeleton`, so the layout holds its shape and nothing jumps when the content arrives.
- Don't: Use `EmptyState` for one empty value, or `EmptyValue` for a whole list with nothing in it.

## See it

- [Empty page](../screens/example-empty-page.md): The list page with nothing in it yet: the toolbar stays, and the space under it says what will appear, with one action.
- [List page](../screens/example-list-page.md): A page that is a list: one toolbar under the header with views, search and a filter, and a table that fills the rest of the window edge to edge.
