Components
'use client';
import { Button } from '@/registry/san-francisco/ui/button';
import {
Empty,
EmptyContent,
EmptyDescription,
EmptyHeader,
EmptyMedia,
EmptyTitle,
} from '@/registry/san-francisco/ui/empty';
import { InboxIcon, SearchIcon } from 'lucide-react';
export default function EmptyDemo() {
return (
<Empty>
<EmptyHeader>
<EmptyMedia>
<InboxIcon />
</EmptyMedia>
<EmptyTitle>No items found</EmptyTitle>
<EmptyDescription>You don't have any items yet. Create one to get started.</EmptyDescription>
</EmptyHeader>
<EmptyContent>
<Button>Create Item</Button>
</EmptyContent>
</Empty>
);
}
bunx shadcn@latest add @sft-ui/empty
The EmptyMedia component supports default and icon variants. The icon variant renders a contained icon with a muted background.
'use client';
import { Button } from '@/registry/san-francisco/ui/button';
import {
Empty,
EmptyContent,
EmptyDescription,
EmptyHeader,
EmptyMedia,
EmptyTitle,
} from '@/registry/san-francisco/ui/empty';
import { InboxIcon, SearchIcon } from 'lucide-react';
export default function EmptyDemoMediaVariants() {
return (
<Empty>
<EmptyHeader>
<EmptyMedia variant="icon">
<SearchIcon />
</EmptyMedia>
<EmptyTitle>No results</EmptyTitle>
<EmptyDescription>Try adjusting your search or filters.</EmptyDescription>
</EmptyHeader>
</Empty>
);
}
The root container for the empty state. All standard HTML div attributes are supported.
Wraps the icon, title, and description at the top of the empty state.
Displays an icon or illustration.
| Prop | Type | Default | Description |
|---|
variant | "default" | "icon" | "default" | "icon" renders a contained icon with a muted background. |
className | string | — | Additional CSS classes to apply. |
The heading text for the empty state.
Supporting text below the title.
A container for action buttons or other content below the header.