Empty
The empty state of a list or pane: a large grey symbol, a title and a hint.
@cupertinoui/emptyRegistry JSON import { InboxIcon, StarIcon } from "lucide-react"
import { Button } from "@/components/ui/button"
import { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from "@/components/ui/empty"
export default function EmptyDemo() {
return (
<div className="grid w-full max-w-2xl gap-4 sm:grid-cols-2">
<Empty className="bg-mac-window shadow-[0_0_0_1px_var(--mac-grid)]">
<EmptyHeader>
<EmptyMedia>
<InboxIcon strokeWidth={1.25} />
</EmptyMedia>
<EmptyTitle>No Messages</EmptyTitle>
<EmptyDescription>Messages you receive appear here.</EmptyDescription>
</EmptyHeader>
</Empty>
<Empty className="bg-mac-window shadow-[0_0_0_1px_var(--mac-grid)]">
<EmptyHeader>
<EmptyMedia variant="icon">
<StarIcon />
</EmptyMedia>
<EmptyTitle>No Favorites</EmptyTitle>
<EmptyDescription>Add websites you visit often to your favorites.</EmptyDescription>
</EmptyHeader>
<EmptyContent>
<Button variant="secondary" size="sm">Add Favorite</Button>
</EmptyContent>
</Empty>
</div>
)
}Installation
pnpm dlx shadcn@latest add @cupertinoui/emptyThe first install also adds the macOS theme. See Installation to set up the registry.
Usage
import { Empty, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from "@/components/ui/empty"
<Empty>
<EmptyHeader>
<EmptyMedia><InboxIcon /></EmptyMedia>
<EmptyTitle>No Messages</EmptyTitle>
<EmptyDescription>Messages you receive appear here.</EmptyDescription>
</EmptyHeader>
</Empty>API Reference
Every part forwards the props of the underlying element. The props below are the ones CupertinoUI adds or changes.
EmptyMedia
| Prop | Type | Description |
|---|---|---|
variant | "default" | "icon"Default: "default" | A large symbol, or a symbol on a tile. |
className | string | Extra classes, merged with the component's own. |
Empty / EmptyHeader / EmptyTitle / EmptyDescription / EmptyContent
| Prop | Type | Description |
|---|---|---|
className | string | Extra classes, merged with the component's own. |