Card
Displays a card with header, content, and footer.
Installation
npx shadcn@latest add cardUsage
Import and use the card component in your project.
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card"Examples
Default
A simple card with header, content, and footer.
Card Title
Card Description
Card Content
Card Footer
With Action
A card with an action button in the header.
Card Title
Card Description
Card Content with action in header
Login Form
A card used as a login form.
Login
Enter your email below to login to your account
Notifications
A card showing a list of notifications.
Notifications
You have 3 unread messages.
Push Notifications
Send notifications to device.
Your call has been confirmed.
1 hour ago
You have a new message!
1 hour ago
Your subscription is expiring soon!
2 hours ago
API Reference
Props available for the Card component and its sub-components.
Card
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | - | Additional CSS classes to apply to the card container. |
CardHeader
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | - | Additional CSS classes to apply to the header. |
CardTitle
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | - | Additional CSS classes to apply to the title. |
CardDescription
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | - | Additional CSS classes to apply to the description. |
CardContent
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | - | Additional CSS classes to apply to the content area. |
CardFooter
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | - | Additional CSS classes to apply to the footer. |
CardAction
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | - | Additional CSS classes to apply to the action area in header. |
Components
On This Page