Card
Displays a card with header, content, and footer.
Usage
Composition
code
Card
├── CardHeader
│ ├── CardTitle
│ ├── CardDescription
│ └── CardAction
├── CardContent
└── CardFooter
Size
Use size="sm" for tighter spacing.
Spacing
Override --card-spacing on the root. Defaults to 1.5rem (size="sm" uses 0.75rem).
Dividers and edge-to-edge content
Add border-b on the header when you want a top divider. Footer already includes a muted bar and top border. Bleed scrollable content with negative margin.
API Reference
Card
| Prop | Type | Default | Description |
|---|---|---|---|
size |
default | sm |
default |
Sets --card-spacing to 1.5rem or 0.75rem |
as |
string |
div |
Root HTML element |
Parts
card-header, card-title, card-description, card-action, card-content, and card-footer all accept as and any HTML attributes (class, id, etc.).
Add border-b on the header when you want a top divider. Footer already includes a muted bar and top border. Bleed content with negative margin.