Card
A container used to display content in a box, resembling a physical card. Composed of several sub-components.
When to use
A Card groups related content in a raised box, with an optional header and footer.
- Prefer
Wellwhen the content is secondary and sits inset in the page, such as a code sample, a note, or a read-only summary. - Prefer
Separatorwhen adjacent content needs a divider and no box. - Prefer
MediaObjectwhen an icon or a figure sits beside a block of text, with no border.
Laborum in aute officia adipisicing elit velit.
Card Title Here
Laborum in aute officia adipisicing elit velit.
Card footer
Card Title Here
Laborum in aute officia adipisicing elit velit.
Laborum in aute officia adipisicing elit velit.
Card footer
Composition
Compose the parts of a Card together to build your own:
Polymorphism
Every Card part accepts an asChild prop. When true, the part renders its single child instead of its default element, forwarding all class names, data-* attributes, and the ref onto that child. Reach for this when a card part should also be a more semantic element: for example, rendering Card.Title as an h2 to fit the surrounding document outline.
Card Title as an h2
Laborum in aute officia adipisicing elit velit.
API Reference
Card.Root
A container that displays content in a box resembling a physical card. The root component of all Card sub-components.
All props from div, plus:
Card.Body
The main content of a card. Usually composed as a direct child of Card.Root.
All props from div, plus:
Card.Footer
The band below Card.Body. Unless it is the first child, it draws a top border dividing the two. Pass it as a direct child of Card.Root.
All props from div, plus:
Card.Header
The band above Card.Body that holds Card.Title. Pass it as a direct child of Card.Root.
All props from div, plus:
Card.Title
The heading inside Card.Header. Renders an h3 by default — pass asChild to fit the surrounding document outline. Keep it a heading element (h1-h6) for accessibility.
All props from h1-h6, plus: