- Accordion
- Action Bar
- Alert Dialog
- Alert
- Announcement
- Aspect Ratio
- Autocomplete
- Avatar
- Badge
- Bottom Navigation
- Breadcrumb
- Button Group
- Button
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Circular Progress
- Circular Slider
- Clipboard
- Collapsible
- Color Picker
- Combobox
- Command
- Context Menu
- Data List
- Date Picker
- Dialog
- Drawer
- Editable
- Field
- File Upload
- Float
- Floating Panel
- Frame
- Hint
- Hover Card
- Image Cropper
- Input Group
- Input OTP
- Input
- Item
- Kbd
- Link Overlay
- Listbox
- Marquee
- Menu
- Native Select
- Number Input
- Pagination
- Popover
- Progress
- Prose
- QR Code
- Radio Group
- Rating
- Resizable
- Scroll Area
- Segment Group
- Select
- Separator
- Sheet
- Sidebar
- Signature Pad
- Skeleton
- Skip Nav
- Slider
- Spinner
- Status
- Steps
- Switch
- Table
- Tabs
- Textarea
- Timer
- Toast
- Toggle Group
- Toggle Tooltip
- Toggle
- Tooltip
- Tour
- Tree View
Installation
pnpm dlx shadcn@latest add https://shark.vini.one/r/card.json
Usage
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CardAction, CardMedia, } from "@/components/ui/card";
<Card> <CardMedia /> <CardHeader> <CardTitle /> <CardDescription /> <CardAction /> </CardHeader> <CardContent /> <CardFooter /> </Card>
Title and Description
<CardHeader /> supports two usage patterns:
Using props
Pass title and description props directly to <CardHeader />.
This approach does not require
<CardTitle />or<CardDescription />components.
<CardHeader title="Card Title" description="Card description"> <CardAction /> </CardHeader>
Using components
Alternatively, use <CardTitle /> and <CardDescription /> as children for more control.
<CardHeader> <CardTitle>Card Title</CardTitle> <CardDescription>Card description</CardDescription> <CardAction /> </CardHeader>
Examples
Product card
A product card with image, title, description, price, and action buttons.
Icon card
A card with an icon at the top and title, description, and action button at the bottom.
15OFFClickable cards
For fully clickable cards, wrap the card with Link Overlay.
Custom spacing
The [--space:--spacing("value")] utility class controls the card spacing.
Breakpoint utilities change the card spacing at different screen sizes.
md:[--space:--spacing(6)] lg:[--space:--spacing(8)]
API Reference
Card
Root wrapper for card layout. Supports header, body, footer.
| Prop | Type | Default |
|---|---|---|
className | string | - |
asChild | boolean | false |
| Attribute | Default |
|---|---|
--space | --spacing(4) |
CardMedia
Image, video, or media area. Often full-width at top.
| Prop | Type | Default |
|---|---|---|
variant | default, icon, image | default |
className | string | - |
asChild | boolean | false |
CardHeader
Header area. Typically holds title and optional actions.
| Prop | Type | Default |
|---|---|---|
title | string | - |
description | string | - |
className | string | - |
asChild | boolean | false |
CardTitle
Card title or heading. Bold by default.
| Prop | Type | Default |
|---|---|---|
className | string | - |
asChild | boolean | false |
CardDescription
Card description or body text. Muted foreground for hierarchy.
| Prop | Type | Default |
|---|---|---|
className | string | - |
asChild | boolean | false |
CardAction
Action button or link in the card header.
| Prop | Type | Default |
|---|---|---|
className | string | - |
asChild | boolean | false |
CardContent
Main body content of the card.
| Prop | Type | Default |
|---|---|---|
className | string | - |
asChild | boolean | false |
CardFooter
Footer area. Typically holds secondary actions or metadata.
| Prop | Type | Default |
|---|---|---|
className | string | - |
asChild | boolean | false |