Primitives
Empty
The Empty component is used to display an empty state, such as no search results, an empty list, or a first-run experience, with an icon, title, description, and optional actions.
Empty Examples
Basic Empty State
No projects yet
Get started by creating your first project.
No Search Results
No results found
Try adjusting your search or filter to find what you're looking for.
Empty Team
No team members
Invite teammates to collaborate on this workspace.
Installation
# The component is already installed at:
# src/components/ui/shadcn/empty.tsx
Usage
import { FolderIcon } from 'lucide-react'
import { Button } from '@/components/ui/shadcn/button'
import {
Empty,
EmptyContent,
EmptyDescription,
EmptyHeader,
EmptyMedia,
EmptyTitle,
} from '@/components/ui/shadcn/empty'
export function EmptyDemo() {
return (
<Empty>
<EmptyHeader>
<EmptyMedia variant="icon">
<FolderIcon />
</EmptyMedia>
<EmptyTitle>No projects yet</EmptyTitle>
<EmptyDescription>
Get started by creating your first project.
</EmptyDescription>
</EmptyHeader>
<EmptyContent>
<Button>Create Project</Button>
</EmptyContent>
</Empty>
)
}
Components
| Component | Description |
|---|---|
| Empty | The root container for the empty state |
| EmptyHeader | Groups the media, title, and description |
| EmptyMedia | Displays an icon, either plain or in a rounded badge (variant="icon") |
| EmptyTitle | The heading of the empty state |
| EmptyDescription | Supporting text |
| EmptyContent | Container for actions, such as buttons |