Card
A bordered container for one item or group, with its title, content and actions.
In Multi-brand
See it live
npm run storybookWhen to use it
In Multi-brand: Plans and products.
- Use it when: A repeating unit of title, media and one destination or action.
- Not when: Records people compare cell by cell (a table), or a whole card as one big link that screen readers read as one.
Instead:
How Multi-brand uses it
Words
- Shared structure: object, state, next step.
- Brand tone lives in headlines and marketing copy, not in errors.
- Errors and confirmations read the same in every brand.
- Use: Get started, Plan, Order. Avoid: Brand-specific words in errors, Jargon.
The labels components use, from the voice tokens:
content.action.commit: Savecontent.action.cancel: Cancelcontent.action.destroy: Removecontent.action.retry: Try againcontent.action.empty-action: Get started
See Voice and tone for the whole voice.
Accessibility and keyboard
Test before you ship:
- One inner link or button names the destination; the rest is not one big link. undefined
Use it in code
npx open-ds add card
The component reads only component keys and semantic tokens, so it follows the brand and mode on <html>.
Tokens it reads
Card reads 17 tokens of its own, each an alias of a semantic token. Each row is one part: its own token, the semantic it aliases, and the value it ends at. Change a semantic and every component that reads it follows; override one of Card's tokens to change Card alone.
Multi-brand decides what changes when you switch theme. Here a switch changes colors, type and shape, so the marked rows differ between its brands and between light and dark; everything else holds steady.
| Part | Its token and the semantic it aliases | Value |
|---|---|---|
| Card | ||
| Fill Changes with theme | component.card.backgroundcolor.surface.defaultvar(--card-background) | Aster Lightslate-deep.light.0:#FFFFFFAster Darkslate-deep.dark.50:#0F172ABirch Lightslate-deep.light.0:#FFFFFFBirch Darkslate-deep.dark.50:#0F172ACoral Lightslate-deep.light.0:#FFFFFFCoral Darkslate-deep.dark.50:#0F172A |
| Border Changes with theme | component.card.bordercolor.border.defaultvar(--card-border) | Aster Lightslate-deep.light.200:#E2E8F0Aster Darkslate-deep.dark.100:#1E293BBirch Lightslate-deep.light.200:#E2E8F0Birch Darkslate-deep.dark.100:#1E293BCoral Lightslate-deep.light.200:#E2E8F0Coral Darkslate-deep.dark.100:#1E293B |
| Corner Changes with theme | component.card.radiusradius.containervar(--card-radius) | Aster Lightradius.8:0.5remAster Darkradius.8:0.5remBirch Lightradius.16:1remBirch Darkradius.16:1remCoral Lightradius.20:1.25remCoral Darkradius.20:1.25rem |
| Padding | component.card.paddingspace.inset.containervar(--card-padding) | space.24:1.5rem |
| Shadow Changes with theme | component.card.shadowelevation.cardvar(--card-shadow) | Aster Lightshadow.cardAster Darkshadow.card-darkBirch Lightshadow.cardBirch Darkshadow.card-darkCoral Lightshadow.cardCoral Darkshadow.card-dark |
| Gap | component.card.gapspace.gap.defaultvar(--card-gap) | space.12:0.75rem |
| Text Changes with theme | component.card.labelcolor.text.primaryvar(--card-label) | Aster Lightslate-deep.light.900:#0F172AAster Darkslate-deep.dark.900:#F8FAFCBirch Lightslate-deep.light.900:#0F172ABirch Darkslate-deep.dark.900:#F8FAFCCoral Lightslate-deep.light.900:#0F172ACoral Darkslate-deep.dark.900:#F8FAFC |
| Border width | component.card.border-widthborder-width.defaultvar(--card-border-width) | border-width.1:1px |
| Header | ||
| Gap | component.card.header.gapspace.gap.tightvar(--card-header-gap) | space.8:0.5rem |
| Title | ||
| Font family Changes with theme | component.card.title.font-familytype.heading.font-familyvar(--card-title-font-family) | Aster Lightfont.family.inter:Inter, system-ui, sans-serifAster Darkfont.family.inter:Inter, system-ui, sans-serifBirch Lightfont.family.plus-jakarta-sans:"Plus Jakarta Sans", system-ui, sans-serifBirch Darkfont.family.plus-jakarta-sans:"Plus Jakarta Sans", system-ui, sans-serifCoral Lightfont.family.poppins:Poppins, system-ui, sans-serifCoral Darkfont.family.poppins:Poppins, system-ui, sans-serif |
| Text size | component.card.title.font-sizetype.heading.font-sizevar(--card-title-font-size) | font.size.20:1.25rem |
| Weight | component.card.title.font-weighttype.heading.font-weightvar(--card-title-font-weight) | font.weight.600:600 |
| Line height | component.card.title.line-heighttype.heading.line-heightvar(--card-title-line-height) | font.line-height.1_2:1.2 |
| Description | ||
| Text Changes with theme | component.card.description.labelcolor.text.secondaryvar(--card-description-label) | Aster Lightslate-deep.light.700:#334155Aster Darkslate-deep.dark.500:#CBD5E1Birch Lightslate-deep.light.700:#334155Birch Darkslate-deep.dark.500:#CBD5E1Coral Lightslate-deep.light.700:#334155Coral Darkslate-deep.dark.500:#CBD5E1 |
| Text size | component.card.description.font-sizetype.body.font-sizevar(--card-description-font-size) | font.size.16:1rem |
| Content | ||
| Gap | component.card.content.gapspace.gap.defaultvar(--card-content-gap) | space.12:0.75rem |
| Footer | ||
| Gap | component.card.footer.gapspace.gap.defaultvar(--card-footer-gap) | space.12:0.75rem |