Empty State
Explain why a collection has no content and what to do next.
Installation
pnpm dlx shadcn@4.18.0 add @siteplane/empty-stateComplete the one-time setup first. Registry JSON lists source files and dependencies.
For this page’s examples, also install:
pnpm dlx shadcn@4.18.0 add @siteplane/avatar @siteplane/avatar-group @siteplane/buttonUsage
import {
Empty,
EmptyHeader,
EmptyTitle,
} from "@/siteplane/components/empty-state";
<Empty>
<EmptyHeader>
<EmptyTitle>No results</EmptyTitle>
</EmptyHeader>
</Empty>;Composition
Empty
├── EmptyHeader
│ ├── EmptyMedia
│ ├── EmptyTitle
│ └── EmptyDescription
└── EmptyContentNo results
When a search or filter matches nothing, say so and offer a way back. Keep the search and filter controls visible so people can adjust them.
Avatar media
Use the default EmptyMedia variant for richer media, such as the people who could join a project.
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
Empty | default | icon | default | Transparent media wrapper, or a compact icon presentation. |
Empty | 1 | 2 | 3 | 4 | 5 | 6 | unset | Heading level: the title renders as h1 to h6, with the same look. Unset, it is a div. |
Empty, EmptyHeader, EmptyMedia, EmptyTitle, EmptyDescription and
EmptyContent accept native div attributes, refs, children and string
className. Empty provides centered layout and vertical spacing. Header groups
the message; Media precedes Title and Description; Content holds actions or
supplementary content. Title is a div unless level makes it a heading. There
are no loading, error, onCreate, size or open props.
Usage notes
Show an empty state after loading has settled. Your application decides whether it means no data yet, no matching results or a recoverable failure, and which action fits. Set level on EmptyTitle when the page outline needs the title as a heading, such as level={2} for an empty state that stands in for a page section.