docs/components/card
Sections
Components
Utilities
Forms
Hooks
Copy Markdown
Displays content about a single subject.
PreviewCode
Login to your account
Enter your email and check your inbox
Sign Up
Send one-time codeLogin with Google
CLIManual
pnpmbunnpmyarn
pnpm dlx shadcn@latest add @shark/card
Card
├── CardMedia
├── CardHeader
│ ├── CardTitle
│ ├── CardDescription
│ └── CardAction
├── CardContent
└── CardFooter
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
CardAction,
CardMedia,
} from "@/components/ui/card";
<Card>
<CardMedia />
<CardHeader>
<CardTitle />
<CardDescription />
<CardAction />
</CardHeader>
<CardContent />
<CardFooter />
</Card>
CardHeader supports two usage patterns:
Pass title and description props directly to CardHeader.
<CardHeader title="Card Title" description="Card description">
<CardAction />
</CardHeader>
This approach does not require
CardTitleorCardDescriptioncomponents.
Use CardTitle and CardDescription as children for more control.
<CardHeader>
<CardTitle>Card Title</CardTitle>
<CardDescription>Card description</CardDescription>
<CardAction />
</CardHeader>
PreviewCode
Living room Sofa
This sofa is perfect for modern tropical spaces, baroque inspired spaces.
Buy nowAdd to cart
PreviewCode
Get 15% OFF
Minimum purchase of $100 required. Use code at checkout.
15OFF
Copy code
The [--space:--spacing("value")] on Card controls the internal spacing.
Default spacing is --spacing(6).
PreviewCode
Login to your account
Enter your email and check your inbox
Sign Up
LoginLogin with Google
You can use breakpoint utilities to change the internal spacing at different screen sizes.
md:[--space:--spacing(6)] lg:[--space:--spacing(8)]
Root wrapper for card layout.
| Prop | Type | Default |
|---|---|---|
className | string | - |
asChild | boolean | false |
| CSS Variable | Default |
|---|---|
--space | --spacing(6) |
Image, video, or media area. Often full-width at top.
| Prop | Type | Default |
|---|---|---|
variant | `"default" | "icon" |
className | string | - |
asChild | boolean | false |
Header area. Typically holds title and optional actions.
| Prop | Type | Default |
|---|---|---|
title | string | - |
description | string | - |
className | string | - |
asChild | boolean | false |
Card title or heading. Bold by default.
| Prop | Type | Default |
|---|---|---|
className | string | - |
asChild | boolean | false |
Card description or body text. Muted foreground for hierarchy.
| Prop | Type | Default |
|---|---|---|
className | string | - |
asChild | boolean | false |
Action button or link in the card header.
| Prop | Type | Default |
|---|---|---|
className | string | - |
asChild | boolean | false |
Main body content of the card.
| Prop | Type | Default |
|---|---|---|
className | string | - |
asChild | boolean | false |
Footer area. Typically holds secondary actions or metadata.
| Prop | Type | Default |
|---|---|---|
className | string | - |
asChild | boolean | false |
[
Previous page
Calendar ](/docs/components/calendar)[
Next page
Carousel ](/docs/components/carousel)
On This Page
InstallationAnatomyUsageTitle & DescriptionUsing propsUsing componentsExamplesProduct cardIcon cardCustom spacingAPI ReferenceCardCardMediaCardHeaderCardTitleCardDescriptionCardActionCardContentCardFooter