Components
Empty
Centered placeholder with a title, a description and actions for a page or section with nothing to show.
import { Empty } from "@openperf/deft";
<Empty.Root>
<Empty.Title>No releases yet</Empty.Title>
<Empty.Description>Releases appear here after the first deploy is reported.</Empty.Description>
</Empty.Root>;When to use
| Need | Component |
|---|---|
| Page or section with no data, or failed to load | Empty |
| Message next to content that is still on screen | Callout |
| Content that is still loading | Skeleton |
Anatomy
<Empty.Root>
<Empty.Title />
<Empty.Description />
<Empty.Actions /> {/* row of buttons */}
</Empty.Root>Every part is optional. Empty.Description is at most 384px wide.
Sizes
| Size | Vertical padding | Use |
|---|---|---|
md | 80px | Pages and large sections |
sm | 32px | Small blocks |
To center the message in the rest of a page, let the root grow with className="flex-1".
In tables and lists
Table.Empty from Table renders an Empty.Root over placeholder rows and takes the same props: put Empty.Title and Empty.Description directly inside it. List.Empty from List is a container with the sm padding for the same parts. Data table builds the whole state from its empty option.
API
Empty.Root
Prop
Type