Card
Card groups related content, actions, forms, or framed data into a clear surface.
Purpose
Card groups related content, actions, forms, or framed data into a clear surface. It is not a general page-layout primitive.
Structured card
Installation
With the Siteplane registry alias configured, add the component and import the installed source from your app.
CLI
pnpm dlx shadcn@4.16.1 add @siteplane/cardImport
import { Card, CardAction, CardContent, CardDescription, CardFooter, CardFrame, CardFrameAction, CardFrameDescription, CardFrameHeader, CardFrameTitle, CardHeader, CardPanel, CardTitle } from "@/components/ui/card";Need the machine-readable source metadata? View registry JSON.
Usage
Card groups related content. Use the header, panel, action and footer slots instead of nested card stacks.
import { Card, CardHeader, CardTitle, CardDescription, CardAction, CardPanel, CardFooter } from "@/components/ui/card";
export function Example() {
return (
<Card>
<CardHeader>
<CardTitle>Workspace</CardTitle>
<CardDescription>Team usage this month.</CardDescription>
<CardAction>
<Button size="sm" variant="outline">Open</Button>
</CardAction>
</CardHeader>
<CardPanel>...</CardPanel>
<CardFooter>Updated now</CardFooter>
</Card>
);
}Examples
Anatomy, header actions, form composition and CardFrame stacks are compositions of the same slots. CardContent is an exported alias for CardPanel.
Basic card
Header action
Form in card
Table in CardFrame
Card frame slots
CardFrame slots wrap stacked cards with a shared header, action and footer.
Render prop
The render prop swaps the underlying element while keeping card styling.
API Reference
The reference lists the source-owned exports and props that are easy to miss in visual examples. Inherited Base UI props remain available unless the wrapper narrows them.
- Compose
CardHeader,CardTitle,CardDescription,CardAction,CardPanel, andCardFooteras needed. CardContentis a compatibility alias forCardPanel; useCardPanelin new code.CardFrameand its slots support framed stacks and table-like content.- Adding
className="border-b"toCardHeaderorclassName="border-t"toCardFooterswitches the adjacent CardPanel to full vertical padding for a visually separated section. - The root
renderprop may change the underlying semantic element.
Motion
Component motion uses the shared Siteplane motion contract. See the global motion guide for provider setup, tokens and reduced-motion behavior.
- Card is a static container with no mount or exit animation.
- Interactive children use their own primitive motion; do not animate Card locally.
- Preserve native radius, clipping, surface, shadow, and slot classes.
Accessibility
- Card is visual grouping and does not replace semantic lists, tables, forms, headings, or landmarks.
- Keep titles meaningful in their surrounding document structure.
- Card actions remain real Button or link controls with visible focus.
- If
renderchanges the root element, retain semantics appropriate to the content.
Implementation Guidance
- Use existing Card and CardFrame slots instead of wrapper primitives.
- Use
CardPanelin new code and treatCardContentonly as a compatibility alias. - Do not use Card as a generic layout box.