Content Only
Body alone, when there is nothing to title.
<Card>
<Card.Body>Just content, no header or footer.</Card.Body>
</Card>Groups related content onto one bounded surface.
import { Card } from "@/fragments/ui";Source<Card>
<Card.Header>
<Card.Title>Card title</Card.Title>
<Card.Description>A brief description</Card.Description>
</Card.Header>
<Card.Body>Related content</Card.Body>npx @usefragments/cli add cardWrites src/fragments/ui/components/Card plus what it imports, the globals stylesheet, and .fragments/registry-lock.json, then prints the packages to add. No account, no key.
Your own registry: publish from Fragments Cloud and add --registry org/name. Connect a workspace.
Card is a compound: import the root and reach its parts through dot notation.
Card.HeaderCard.TitleCard.DescriptionCard.BodyCard.FooterQuiet surface with a title and description.
<Card>
<Card.Header>
<Card.Title>Card title</Card.Title>
<Card.Description>A brief description</Card.Description>
</Card.Header>
<Card.Body>Related content</Card.Body>
</Card>Body alone, when there is nothing to title.
<Card>
<Card.Body>Just content, no header or footer.</Card.Body>
</Card>Footer parks the actions below the content.
<Card>
<Card.Header>
<Card.Title>Card with footer</Card.Title>
<Card.Description>Complete card layout</Card.Description>
</Card.Header>
<Card.Body>Main content area.</Card.Body>Divided header; the body owns its own spacing.
<Card variant="soft" padding="none">
<Card.Header divided>
<Card.Title>Overview</Card.Title>
</Card.Header>
<Card.Body padding="md">Panel content</Card.Body>
</Card>Earned-moment capsule: accent hairline and wash, for the few surfaces that deserve emphasis.
<Card variant="soft" tone="accent" padding="lg">
<Card.Header>
<Card.Title>Finish setting up governance</Card.Title>
<Card.Description>Run the first scan to start tracking drift.</Card.Description>
</Card.Header>
</Card>The same capsule carrying state: the wash and hairline follow the tone.
<Card variant="soft" tone="danger">
<Card.Header>
<Card.Title>Merge held</Card.Title>
<Card.Description>Two blocking findings need a decision.</Card.Description>
</Card.Header>
</Card>onClick adds keyboard and button behaviour to the whole surface.
<Card as="section" onClick={() => undefined}>
<Card.Header>
<Card.Title>Open details</Card.Title>
<Card.Description>This card is interactive</Card.Description>
</Card.Header>
<Card.Body>Activate the card to view more.</Card.Body>The as prop matches the surrounding document semantics.
<Card as="section" aria-labelledby="billing-card-title">
<Card.Header>
<Card.Title id="billing-card-title">Billing summary</Card.Title>
</Card.Header>
<Card.Body>Section semantics support the surrounding document outline.</Card.Body>
</Card>Pick the heading level the page outline expects.
<Card variant="soft" padding="none">
<Card.Header divided>
<Card.Title as="h4">Nested panel</Card.Title>
</Card.Header>
<Card.Body padding="md">Panel content</Card.Body>
</Card>Long titles and dense text wrap without breaking the surface.
<Card>
<Card.Header>
<Card.Title>
A detailed localized account recovery policy for administrators across multiple
workspaces
</Card.Title>Prop | Type | Default | Description |
|---|---|---|---|
as | enumarticledivsection | article | Root element tag. |
childrenRequired | node | Not set | — |
padding | enumnonesmmdlg | md | Inner padding. |
style | object | Not set | — |
tone | enumneutralaccentwarningdanger | neutral | Earned-moment capsule. Any tone other than `neutral` paints a tone-tinted hairline, a radial wash and the capsule radius on top of the variant: `accent` (the moment), `danger` (a merge is held), `warning` (enforcement lapsed). Reserve it for the few surfaces that earn emphasis. |
variant | enumsolidsoftoutline | solid | Surface chrome. - `solid`: the filled, elevated surface for general-purpose cards. - `soft`: quiet tint fill for metric tiles and dashboard panels. Add `padding="none"` and let `Card.Header divided` + `Card.Body padding` own their inset for a panel. - `outline`: transparent with a hairline border, for dense layouts. |
Do not use a Card as a modal surface.
Don’t
<Card>Confirm deletion</Card>Do
<Card variant="outline">
<Card.Body>Inline summary</Card.Body>
</Card>