Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Avatar
- Badge
- Breadcrumb
- Button
- Button Group
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Code Block
- Collapsible
- Combobox
- Command
- Context Menu
- Copy Button
- Data Table
- Date Picker
- Dialog
- Drawer
- Dropdown Menu
- Empty
- Field
- Form
- Hover Card
- Input
- Input Group
- Input OTP
- Item
- Kbd
- Label
- Menubar
- Native Select
- Navigation Menu
- Page Header
- Pagination
- Panel
- Popover
- Progress
- Radio Group
- Resizable
- Scroll Area
- Section Header
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spinner
- Stat
- Stat Card
- Switch
- Table
- Tabs
- Textarea
- Theme Toggle
- Toggle
- Toggle Group
- Tooltip
- Typography
Card
Displays a card with header, content, and footer.
Create project
Deploy your new project in one click.
Frame content with hairline borders.
01
Installation
Add the card component with the shadcn CLI.
bash
npx shadcn@latest add https://swiss.ui.unsanity.ai/r/card.json02
Usage
tsx
import { Card } from "@/components/ui/card"03
Examples
With action
CardHeader + CardActionNotifications
You have 3 unread messages.
Card actions sit in the top-right of the header.
import { SettingsIcon } from "lucide-react"
import { Button } from "@/components/ui/button"
import {
Card,
CardAction,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card"
<Card className="w-72">
<CardHeader>
<CardTitle>Notifications</CardTitle>
<CardDescription>You have 3 unread messages.</CardDescription>
<CardAction>
<Button variant="ghost" size="icon-sm" aria-label="Settings">
<SettingsIcon />
</Button>
</CardAction>
</CardHeader>
<CardContent>Card actions sit in the top-right of the header.</CardContent>
</Card>Content only
No header or footerA card can be just a bordered content surface.
import { Card, CardContent } from "@/components/ui/card"
<Card className="w-72">
<CardContent>
A card can be just a bordered content surface.
</CardContent>
</Card>