Empty states
Explains why there is nothing to show and offers the next step.
An empty view is not an error. It is a moment to say what will appear here and how to start. There are three different causes, and each needs different words and a different action: nothing has been created yet, nothing matches what the person asked for, or the work is finished.
Anatomy
- Empty with its header, title, description and content parts.
- A media slot: an icon for first use and no results, the brand state square for finished work.
- One Button for the main next step, and at most one quieter link.
- Input and Table around it when the empty state replaces a list.
First use, no results and cleared
One working page that moves through all three. Create the first purchase order, search for something that is not there, then mark everything received.
Choose it as the model for a list or a table.
Inside a page
Smaller empty states inside tabs of a supplier page: documents never uploaded, quality issues all closed, contacts that do not match a filter. Each keeps the rest of the page working.
Choose it for panels and tabs, where a full-page treatment would be too large.
Which one to use
| Cause | Say | Offer |
|---|---|---|
| First use | What will appear here and why it matters | Create the first one, or import |
| No results | What was searched, and how to widen it | Clear the search or filter |
| Cleared or completed | That the work is done, and what comes next | Show finished items |
Behaviour
- The empty state replaces only the list. The title, search and filters stay.
- Clearing a search moves focus back to the search field.
- Creating the first item moves focus to the new content.
- Responsive: the content is centred and wraps from 320px upwards.
On a phone
Both blocks put pointer-coarse:touch-controls on the page. An empty state exists to offer the first action, and on a phone that action is pressed with a finger. The tables in these blocks hold no controls, so the scope does not change them. See Sizing.
Accessibility
- The title is real text, not an image. Icons are decorative.
- A change from results to empty is announced through a status region that says how many items are shown.
- The action is a button or a link with a label that names the outcome.
Content
- The title says what is true: "No purchase orders yet", "No orders match Lombardia".
- The description says what will appear and how to start, in one or two sentences.
- The button starts with a verb: Create purchase order, Clear search.
Say what will appear here and give the first step.
Don’t leave a dead end with no reason and no action.
Install
pnpm dlx shadcn@latest add @silkware/empty-states-01pnpm dlx shadcn@latest add @silkware/empty-states-02