EmptyState
The canonical "nothing here" surface.
Signature
Density
Viewport
Theme and light/dark are set in the top barWhen to use
- Use it when A zero / no-results / error / offline state, with a clear next step.
- Reach for something else when Brief loading — use
Spinneror a skeleton.
Accessibility
Communicates the situation in words and offers a clear next step; not reliant on illustration alone.
Install and import
npx shadcn@latest add @prism/empty-state
import { EmptyState } from '@/components/prism/EmptyState';
In a no-build prototype, read it from the bundle instead: const { EmptyState } = window.PrismDesignSystem_39d121;
Examples
No results
<EmptyState variant="no-results" title="No matches"
description="Try a different search." />
Error with retry
<EmptyState variant="error" title="Couldn’t load invoices"
actions={<Button onPress={retry}>Try again</Button>} />
Props
| Prop | Type | Required | Description |
|---|---|---|---|
variant | EmptyVariant | — | Picks the default glyph + tone. Default "empty". Not a style flag — each variant needs different COPY. "empty" explains the thing and offers the action that creates one; "no-results" offers to clear the filter and needs no explanation; "success" confirms and offers nothing; "error" apologises and may retry; "permission" must NOT offer retry — say who to ask, because "Try again" on a 403 is a lie. |
size | EmptySize | — | Footprint. Default "section". |
title | React.ReactNode | — | |
titleAs | "p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | — | Render the title as a heading — e.g. "h1" for an error page drawn with EmptyState. Default "p". |
description | React.ReactNode | — | |
icon | React.ReactNode | — | Swap just the glyph (keeps the tinted disc). |
illustration | React.ReactNode | — | Replace the disc entirely with custom artwork. |
actions | React.ReactNode | — | Buttons / links rendered below the copy. |
aux | React.ReactNode | — | Small auxiliary line under the actions (page/section only). |
reference | React.ReactNode | — | Request/trace id, printed verbatim and selectable. Never behind a disclosure — it is the first thing support asks for. |