Overview
Reference usage
Surface container for grouping related content and actions into a distinct visual unit.
Usage
Danger Zones
Use tone="danger" when a settings section or action group has destructive, irreversible, or broad-scope consequences. The tone paints the Card container and generated title icon, and the border too when edge="border" so applications do not need to hand-roll danger-zone borders or backgrounds. Put the concrete state or action in the body and use ConfirmDialog for irreversible or workspace-wide changes.
Suggested content
Use tone="suggested" for content the product drafted that is not saved until the person confirms it, such as a suggested next action. The card says so in words: a quiet "Suggested" label in the accent text colour on a line above its title, or at the top of the body when the card has no title. suggestedLabel changes the words, for example to "Suggested wording". The card keeps its own surface: no tint, no dashed or accent border and no pill, so a suggestion never reads as a drop zone or a wireframe.
Do mark every drafted value the same way, and confirm or discard it with a visible action. Don't tint the card, outline it in the accent colour or add a badge to say it is a suggestion: the words carry it.
Edge
A card draws one edge, never two. edge="none" (the default) draws neither: in light mode it draws only the quiet page hairline that parts a white card from the white page, and in dark mode the surface step separates the card from the page; edge="border" is a hairline outline for a real panel; edge="shadow" is a soft shadow with no visible border. There is no prop that asks for both, so a card cannot end up with a border and a shadow together. The choice applies across every variant and tone, including variant="well" and tone="danger".
Header actions
Pass an actions snippet to a card with a title to put controls at the end of the title row, aligned to the title's baseline. Buttons inside draw at the xs control height (24px) whatever size they ask for, and a custom header snippet gets the same treatment, so a header is never taller than its title because of a button. On coarse pointers a button keeps a 44px hit area through invisible padding, not visual height. actions is ignored on an interactive card (href or onclick), because a control cannot nest inside the whole-card link or button.
Footer
The footer is the last row of the card's content, not a band of its own: it draws no divider, its actions sit at the inline end, and the gap between the words and the actions is the body's own bottom padding, so the actions sit the card's padding in from its edges. footerTone="muted" is the one footer that separates itself, by an inset fill and never by a line. A footer under a padding="none" body, under the header with no body, or under a variant="well" body keeps its own top padding.
Header divider
The header is separated from the body by its surface alone. Pass headerDivider to draw a rule under it; the divider is opt-in, so a card that already has an edge is not ruled a second time.
Media
Pass a media snippet for an image or other media drawn at a set aspect ratio. It sits across the top of the card by default; mediaPosition="leading" puts it in a column before the content. mediaAspectRatio sets the ratio ("16 / 9" by default), and a plain img, picture, video or svg inside fills the box and is cropped to fit. Media is optional: a card without it draws no placeholder and reserves no space, so a design that has images for only some entries stays quiet for the rest.
Interaction States
A card becomes interactive when it receives href (the whole card renders as an anchor) or onclick (the whole card renders as a <div> with a stretched hit-target <button> covering it). Either way, hover strengthens whichever edge the card has (a darker border for edge="border", a deeper shadow for edge="shadow") under a hover-capable pointer, and keyboard focus paints a visible ring on the outer card itself — never only on the inner control — so the whole-card-is-a-link pattern gets a correct focus indicator without a consumer needing to do anything extra.
When to use
- Grouping a self-contained unit of content such as a summary, preview, or settings panel.
- Composing a list of comparable items where each needs its own framed region.
- Rendering a bare visual surface without slotted regions — use surface instead.
- Presenting a single key metric — use statistic or statistic-group instead.
Examples
Basic card
A plain bordered card with a single body region.
Blog post grid
An article-listing section recipe: Cards carry post image, category metadata, linked title, excerpt, and an Avatar author byline.
Danger zone action
A destructive action inside a danger-tone Card with the confirmation flow delegated to ConfirmDialog.
Danger zone setting
A high-risk settings card with container-level danger treatment, a switch, and a confirmation dialog before the risky state is applied.
Card edge
A card draws one edge, never two: a hairline border (the default) or a soft shadow.
Card, edge-to-edge on mobile
A card that bleeds to the viewport edge below the mobile breakpoint.
Flush body (padding="none")
Pass padding="none" to remove the body padding for full-bleed content such as an image or a data table.
Header actions
An actions snippet sits on the title's baseline. Buttons in it draw at the xs control height, so the header is the same height with or without them.
Card header divider
The rule under the header is opt-in. Without headerDivider the header is separated from the body by its surface alone.
An optional media slot
A media snippet fills a box at a set aspect ratio above the header. A card without media draws no placeholder and reserves no space.
Card with a muted header
headerTone="muted" draws the header as an inset band over the rows beneath it.
Plain
A plain card is a heading and its content on the page, with no box: no fill, no border and no shadow. Shown beside the default card.
Team roster
A meet-the-team section recipe: profile Cards with an Avatar, role, bio, and profile link, plus an AvatarGroup summary row above the grid.
Testimonial grid
A social-proof section recipe: Cards hold customer blockquotes with an Avatar byline attributing each quote to a person and company.
Well
A flatter inset container for low-emphasis grouped content.
Well, edge-to-edge on mobile
A well that bleeds to the viewport edge below the mobile breakpoint.
Well on grey
A well presented on a muted surrounding surface.
Card with grey body
A card whose body uses the muted surface tone.
Card with header
A card with a separated header region above the body.
Props
Name | Type | Default | Description |
|---|---|---|---|
children required | snippet | ||
header | snippet | Card with a custom header snippet — full control over header content. | |
title | text | ||
headingLevel | 23456 | 3 | Heading level for the generated title. Defaults to 3. Set this so the
card title nests correctly within the surrounding document outline. |
description | text | Optional subheading rendered as a paragraph below the title inside the header. | |
footer | snippet | ||
actions | snippet | Actions rendered at the end of the title row, aligned to the title's baseline. Buttons
inside draw at the xs control height, so they never make the header taller. Ignored
when the card is interactive (href or onclick), because a control cannot nest inside
the whole-card link or button. | |
variant | 'card' | 'well' | 'plain' | 'card' | Visual container style. card is raised; well is flatter and inset; plain is a heading on the page with no box. |
tone | 'default' | 'danger' | 'suggested' | 'default' | Container treatment. danger renders a danger-zone surface for high-risk settings or destructive actions.
suggested marks drafted content that is not saved until confirmed: a quiet accent text label on a
line above the title (or at the top of the body when the card has no title), with no tint, border or pill. |
suggestedLabel | text | 'Suggested' | The words of the suggested label, such as "Suggested wording". Used with tone="suggested". |
bodyTone | 'default' | 'muted' | 'default' | Body surface treatment. muted renders a grey/inset body region. |
footerTone | 'default' | 'muted' | 'default' | Footer surface treatment. muted renders a grey/inset footer region. |
headerTone | 'default' | 'muted' | 'default' | Header surface treatment. muted renders a grey/inset header region, for a card whose title row reads as a band over its rows. |
edgeToEdgeOnMobile | boolean | false | Remove side borders/radius and bleed to the viewport edge on narrow screens. |
padding | 'default' | 'none' | 'default' | Body padding. none leaves header and footer padding intact while making body content flush with the card edges. |
edge | 'none' | 'border' | 'shadow' | 'none' | The one edge the card draws: none (default), a border, or a shadow, never both. In light mode a
none card draws the quiet page hairline so it parts from the white page; in dark it draws nothing and
the surface step separates it. An interactive card strengthens whichever edge it has on hover. |
headerDivider | boolean | false | Draw a divider rule under the header. Off by default: the header is separated from the body by its surface alone, and a divider is opt-in. |
media | snippet | An optional image or other media, drawn at a set aspect ratio at the top of the card or in a leading column. A card with no media draws no placeholder and reserves no space. | |
mediaPosition | 'top' | 'leading' | 'top' | Where the media sits: top spans the card above the header, leading is a column before the content. Used with media. |
mediaAspectRatio | text | '16 / 9' | The aspect ratio of the media box, such as "16 / 9" or 1. The media fills it and is cropped to fit. Used with media. |
href | text | ||
onclick | (event: MouseEvent) => void | Click handler that makes the entire card a button. |