Skip to Content
ComponentsCard

Card

A container that groups related content and actions in a structured, elevated surface.

Project Alpha
Your latest project is live and running.

Last updated 2 minutes ago. All systems operational.

import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, } from "@/components/ui/card"
<Card> <CardHeader> <CardTitle>Title</CardTitle> <CardDescription>Description</CardDescription> </CardHeader> <CardContent> <p>Content goes here.</p> </CardContent> <CardFooter> <Button>Action</Button> </CardFooter> </Card>

Examples

Simple card

Notifications
You have 3 unread messages.

Check your inbox to stay up to date.

<Card className="w-80"> <CardHeader> <CardTitle>Notifications</CardTitle> <CardDescription>You have 3 unread messages.</CardDescription> </CardHeader> <CardContent> <p className="text-sm text-muted-foreground">Check your inbox to stay up to date.</p> </CardContent> </Card>

With action in header

Use CardAction to place an action (button, badge, etc.) in the top-right corner of the header.

Team
Manage your team members.

3 members · 1 pending invite

<Card className="w-80"> <CardHeader> <CardTitle>Team</CardTitle> <CardDescription>Manage your team members.</CardDescription> <CardAction> <Button variant="outline" size="compact">Invite</Button> </CardAction> </CardHeader> <CardContent> <p className="text-sm text-muted-foreground">3 members · 1 pending invite</p> </CardContent> </Card>
Delete account
This action cannot be undone.

All your data will be permanently removed from our servers.

<Card className="w-80"> <CardHeader> <CardTitle>Delete account</CardTitle> <CardDescription>This action cannot be undone.</CardDescription> </CardHeader> <CardContent> <p className="text-sm text-muted-foreground">All your data will be permanently removed.</p> </CardContent> <CardFooter className="gap-2"> <Button variant="outline" size="compact">Cancel</Button> <Button variant="destructive" size="compact">Delete</Button> </CardFooter> </Card>
Last updated on