EmptyState
Generic empty state, composed on Empty. Replaces the per-feature
"nothing here" implementations with one flat-props preset: an icon (or custom
media), a title, optional description, and optional actions.
Usage
import { EmptyState, EmptyStateProps } from "@desk/ui/components/empty-state";Best practices
Use
EmptyStatefor "no data / nothing here"; a failure the user can retry is anErrorState(which also composesEmpty), so don't hand-roll a retry empty.Set
levelto keep the document outline gapless at each migration site — a full-page empty near anh2wantslevel="3", but a nested one may need"4".
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| actions | React.ReactNode | Actions rendered in | |
| description | React.ReactNode | Supporting copy rendered in | |
| icon | LucideIcon | Icon shown above the title, via | |
| iconPlain | boolean | Render the icon bare, without the rounded | |
| iconTone | "neutral" | "brand" | "danger" | "warning" | "success" | "info" | null | undefined | Icon box surface tone (also tints the bare icon when | |
| level | HeadingLevel | "3" | Heading level passed to |
| media | React.ReactNode | Custom media (illustration / | |
| title | React.ReactNode | Heading text. | |
| layout | EmptyLayout | "centered" | Layout variant. |
| minHeight | string | "min-h-[50vh]" | Tailwind min-height class applied only in the |
| size | "base" | "sm" | "lg" | null | undefined |
Also exports
- interface
EmptyStateProps
Composition
Builds on