Skip to content

Card ​

A white panel that groups related content on a page: a form section, a summary, a stat, a table.

Open in Storybook to try every prop.

When to use ​

Use a Card forUse instead
A section of a page or form, with a headingContent inside a popover or slideover (they're already panels)
A stat or summary beside other contentA whole page's content (put it on the page background)
A table, at full width (padding="none")Something people press as a whole (use a Button or link)

Anatomy ​

PartRequiredNotes
containerYesWhite, 1px black 15% border, 8px corners. A size container for its children.
titleNoHeading (h2 by default). Names the card as a region.
descriptionNoGrey text under the title.
actionsNoTop right, beside the title, e.g. an Edit button.
bodyYesThe content (default slot).
footerNoUnder a divider, right-aligned, e.g. Cancel / Save.

Properties ​

PropertyTypeDefaultDescription
titlestring—Heading and accessible name.
descriptionstring—Under the title.
headingLevel2 | 3 | 42To fit the page outline.
paddingmd | sm | nonemdSee Sizes.
assection | aside | article | divsection with a title, else divElement to render.
ui—Extra classes per part.

Sizes ​

PaddingInsideFooter paddingUse for
md16px; 24px from the sm breakpoint (640px)12px / 16px; 16px / 24px from smSections, forms
sm16px12px / 16pxStats, summaries
none012px / 16pxTables, lists that run to the edges (clipped to the corners)
PartValue
Gap between header and content16px
Gap between title and description4px
Title16px / 24px, bold
Description14px / 20px, regular, black 65%
Corner radius8px (rounded-lg), larger than controls' 4px, as a container
Border1px black 15% (also the footer divider)

States ​

Not interactive: one state.

Layout ​

RuleValue
Space between cards16px in a grid, 24px stacked in a column
Background behind cardsPage background #E1E1E1
Children's layoutUse container queries (@sm:, @lg: …), so content lays out by the card's width, not the window's

Accessibility ​

PartAnnounced as
Card with a titleregion (a <section>), named by its heading
Card without a titlePlain container, not a landmark
as="aside"complementary landmark, e.g. a summary beside a form
ContrastRatio
Title on white19.5:1
Description (black 65%) on whiteabout 6.5:1
Card borderDecorative: the white on grey also marks the edge

Platform adaptation ​

PlatformImplementationDifferences
Web / desktop (Vue)Card.vue—
iOS (SwiftUI)—GroupBox, or a grouped List section with a header.
Android (Compose)—OutlinedCard.

Tokens used ​

TokenUsed for
color whitebackground
color black (15%)border, footer divider
color black (65%)description

Do / Don't ​

DoDon't
Give section cards a title, so they're findable as regionsNest cards inside cards
Put a page's main actions at the top of the pagePut the page's only Save in one card's footer when it saves the whole page
Use padding="none" for tablesWrap a table in padding and a second border

Released under the PolyForm Noncommercial License 1.0.0.