Getting Started
Components52
- Accordion
- Alert
- Alert Dialog
- Attachment
- Badge
- Breadcrumb
- Bubble
- Button
- Button Group
- Calendar
- Card
- Checkbox
- Collapsible
- Command
- Context Menu
- Data Table
- Dialog
- Drawer
- Dropdown Menu
- Empty
- Field
- Hover Card
- Input
- Input Group
- Item
- Kbd
- Label
- Marker
- Menubar
- Message
- Message Scroller
- Pagination
- Popover
- Progress
- Questionnaire
- Radio Group
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toggle
- Toggle Group
- Tooltip
No projects yet
You haven't created any projects yet. Get started by creating your first project.
Learn more
import { ArrowUpRightIcon, FolderIcon } from "lucide-react"
import { Button } from "@/components/ui/button"
import {
Empty,
EmptyContent,
EmptyDescription,
EmptyHeader,
EmptyMedia,
EmptyTitle,
} from "@/components/ui/empty"
export function EmptyDemo() {
return (
<Empty>
<EmptyHeader>
<EmptyMedia variant="icon">
<FolderIcon />
</EmptyMedia>
<EmptyTitle>No projects yet</EmptyTitle>
<EmptyDescription>
You haven't created any projects yet. Get started by creating
your first project.
</EmptyDescription>
</EmptyHeader>
<EmptyContent>
<div className="flex gap-2">
<Button>Create project</Button>
<Button variant="secondary">Import project</Button>
</div>
</EmptyContent>
<Button
variant="link"
className="text-muted-foreground dark:text-muted-foreground"
size="sm"
render={<a href="#" />}
nativeButton={false}
>
Learn more <ArrowUpRightIcon data-icon="inline-end" />
</Button>
</Empty>
)
}Installation#
pnpm dlx shadcn@latest add https://ui.ikramhasan.com/r/empty.json
Usage#
import {
Empty,
EmptyContent,
EmptyDescription,
EmptyHeader,
EmptyMedia,
EmptyTitle,
} from "@/components/ui/empty"<Empty>
<EmptyHeader>
<EmptyMedia variant="icon">
<Icon />
</EmptyMedia>
<EmptyTitle>No data</EmptyTitle>
<EmptyDescription>No data found</EmptyDescription>
</EmptyHeader>
<EmptyContent>
<Button>Add data</Button>
</EmptyContent>
</Empty>Examples#
Outline#
Use the border utility class to give the empty state a dashed outline.
Cloud storage empty
Upload files to your cloud storage to access them anywhere.
import { CloudIcon } from "lucide-react"
import { Button } from "@/components/ui/button"
import {
Empty,
EmptyContent,
EmptyDescription,
EmptyHeader,
EmptyMedia,
EmptyTitle,
} from "@/components/ui/empty"
export function EmptyOutline() {
return (
<Empty className="border">
<EmptyHeader>
<EmptyMedia variant="icon">
<CloudIcon />
</EmptyMedia>
<EmptyTitle>Cloud storage empty</EmptyTitle>
<EmptyDescription>
Upload files to your cloud storage to access them anywhere.
</EmptyDescription>
</EmptyHeader>
<EmptyContent>
<Button variant="secondary" size="sm">
Upload files
</Button>
</EmptyContent>
</Empty>
)
}Background#
Use the bg-* utilities to fill the empty state.
No notifications
You're all caught up. New notifications will appear here.
import { BellIcon, RefreshCcwIcon } from "lucide-react"
import { Button } from "@/components/ui/button"
import {
Empty,
EmptyContent,
EmptyDescription,
EmptyHeader,
EmptyMedia,
EmptyTitle,
} from "@/components/ui/empty"
export function EmptyBackground() {
return (
<Empty className="h-full bg-muted">
<EmptyHeader>
<EmptyMedia variant="icon">
<BellIcon />
</EmptyMedia>
<EmptyTitle>No notifications</EmptyTitle>
<EmptyDescription>
You're all caught up. New notifications will appear here.
</EmptyDescription>
</EmptyHeader>
<EmptyContent>
<Button variant="secondary" size="sm">
<RefreshCcwIcon data-icon="inline-start" />
Refresh
</Button>
</EmptyContent>
</Empty>
)
}Input Group#
You can add an InputGroup to the EmptyContent component.
404 - Not Found
The page you're looking for doesn't exist. Try searching for what you need below.
/
Need help? Contact support
import { SearchIcon } from "lucide-react"
import {
Empty,
EmptyContent,
EmptyDescription,
EmptyHeader,
EmptyTitle,
} from "@/components/ui/empty"
import {
InputGroup,
InputGroupAddon,
InputGroupInput,
} from "@/components/ui/input-group"
import { Kbd } from "@/components/ui/kbd"
export function EmptyInputGroup() {
return (
<Empty>
<EmptyHeader>
<EmptyTitle>404 - Not Found</EmptyTitle>
<EmptyDescription>
The page you're looking for doesn't exist. Try searching for
what you need below.
</EmptyDescription>
</EmptyHeader>
<EmptyContent>
<InputGroup className="sm:w-3/4">
<InputGroupInput placeholder="Try searching for pages..." />
<InputGroupAddon>
<SearchIcon />
</InputGroupAddon>
<InputGroupAddon align="inline-end">
<Kbd>/</Kbd>
</InputGroupAddon>
</InputGroup>
<EmptyDescription>
Need help? <a href="#">Contact support</a>
</EmptyDescription>
</EmptyContent>
</Empty>
)
}API Reference#
| Part | Element | Notes |
|---|---|---|
Empty | div | The container. Dashed outline when you add border. |
EmptyHeader | div | Holds the media, title and description. |
EmptyMedia | div | variant: default (your content as is) or icon (a raised 40px key with two tiles fanned out behind it, 20px icon). |
EmptyTitle | div | The title. |
EmptyDescription | div | The description. Links are underlined. |
EmptyContent | div | Actions, inputs or other content below the header. |