Cards for content, metrics, and actions—with subtle motion.
npx shadcn@latest add @iconiq/cardimport {
Card,
CardAction,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
export function CardUsage() {
return (
<Card className="w-full max-w-sm">
<CardHeader>
<CardTitle>Release checklist</CardTitle>
<CardDescription>
Track the final items before shipping the next docs refresh.
</CardDescription>
<CardAction>
<span className="rounded-md bg-muted px-2 py-0.5 text-[11px] font-medium">
In review
</span>
</CardAction>
</CardHeader>
<CardContent className="space-y-2 text-sm">
<p>Accessibility pass on interactive cards.</p>
<p>Registry docs for media slots.</p>
</CardContent>
</Card>
);
}childrenCompose CardHeader, CardContent, CardFooter, media, or custom blocks inside the shared card shell.
Type ReactNode
interactiveEnables the restrained hover lift and stronger surface response intended for clickable or focusable cards.
Type boolean·Default false
asChildMerges the card surface classes and interaction handlers onto the single child element, which is useful for link or button cards.
Type boolean·Default false
classNameMerged onto the root card surface for local spacing, border, or layout adjustments without replacing the slot API.
Type string
onHoverStartCalled when interactive hover feedback begins from pointer, focus, or keyboard focus within the card.
Type () => void
onHoverEndCalled when interactive hover feedback ends after pointer leave and focus exits the card.
Type () => void
childrenCompose CardTitle, CardDescription, and optional CardAction inside the header grid.
Type ReactNode
classNameMerged onto the header grid wrapper.
Type string
childrenHeading content for the card. Works with links, badges, metrics, or richer inline content.
Type ReactNode
classNameMerged with the default title typography classes.
Type string
asSemantic heading element used for the title. Defaults to h3 for accessible card headings.
Type "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div" | "span"·Default "h3"
childrenSupporting description or excerpt text rendered with muted body styling.
Type ReactNode
classNameMerged with the muted description typography classes.
Type string
asSemantic text element used for the description. Defaults to p for accessible supporting copy.
Type "p" | "div" | "span"·Default "p"
childrenAction content such as a menu trigger, status pill, or compact control.
Type ReactNode
classNameMerged with the default action placement classes.
Type string
childrenMain card body content rendered inside the padded content slot.
Type ReactNode
classNameMerged with the default horizontal padding classes.
Type string
childrenFooter content rendered on a quieter separated surface beneath the body.
Type ReactNode
classNameMerged with the default footer surface and spacing classes.
Type string
altAccessible alternative text for the image.
Type string
srcImage source passed through to next/image.
Type string
insetWhen true, wraps the image in the padded card media frame. Set false for edge-to-edge media.
Type boolean·Default true
fillUses fill layout when true. Defaults to fill when width and height are both omitted.
Type boolean
sizesResponsive sizes hint forwarded to next/image for better loading performance.
Type string·Default "(max-width: 768px) 100vw, 400px"
classNameMerged onto the rendered image element.
Type string
childrenNon-image media content such as video, a chart container, or an embed.
Type ReactNode
insetWhen true, wraps children in the padded card media frame. Set false for edge-to-edge media.
Type boolean·Default true
classNameMerged onto the outer media wrapper.
Type string
Patterns for whole-card navigation and cards that contain separate interactive controls.
Whole-card link: <Card asChild interactive><a href="/post">...</a></Card>.
Whole-card button: <Card asChild interactive><button type="button">...</button></Card>.
Card with its own CTA: keep Card unwrapped and place buttons or links inside CardContent or CardFooter.
Do not wrap a card that already contains buttons or links in another anchor or button via asChild.
Layout changes are animated through Motion so expanding or swapping card content feels fluid rather than abrupt.
When interactive is enabled, hover drives a spring-smoothed motion value so lift, scale, and shadow ease in and out as one fluid surface; compound slots only animate layout when content changes.
interactive only changes the visible surface response: border, shadow, and a very small hover lift. The component does not add button semantics on its own.
prefers-reduced-motion disables spring hover and layout transitions. Interactive cards still get border and surface feedback through CSS.
asChild cards use CSS-based hover lift instead of spring transforms so the merged anchor or button remains the interactive root. Lift is also skipped when prefers-reduced-motion is enabled.
Install the exact registry entry shown on the right when you want the component file and its declared runtime dependencies together.
Dependencies: motion, @radix-ui/react-slot.
CardImage requires a Next.js project because it always renders next/image.
Use CardMedia only for non-image media such as video, charts, or embeds.
This page lives in the Components section, but the install itself is the shared Iconiq card primitive rather than a Radix UI or Base UI wrapper.
The provider switch is shown for section consistency, but both Radix UI and Base UI options are disabled because Card does not ship primitive-specific variants here.
The generated registry file is /r/card.json.
Contact
Additionally, if you find any bug or issue, feel free to raise an issue.