Card
A card shows one thing among others: its name, a title, a line of writing and a picture of it that can run off the card’s foot and end edge and be cut there, never framed. Cards stand side by side in a slide or a grid. Ordinary writing still sits straight on the paper; a card is not a box for a page’s paragraphs.
Design examples
Section titled “Design examples”An outlined card and a filled card show different emphasis with the same title and label structure.
<section class="specimen">
<div class="columns"><ds-card variant="outlined" width="12" height="12" href="#light"><span slot="label">Photography</span><span slot="title">Rooms of light</span><ds-text literal wrap tone="muted">18 October — 12 November</ds-text></ds-card><ds-card tone="pink" width="12" height="12" href="#sound"><span slot="label">Sound</span><span slot="title">A place to listen</span><ds-text literal wrap>Recordings from the coast</ds-text></ds-card></div>
</section>
<style>
.specimen { width: 100%; min-width: 0; --cell: calc(20px * var(--sf, 1)); }
.specimen .line { width: 100%; }
.specimen .grow { flex: 1; min-width: 0; }
.specimen .muted { color: var(--ds-text-color-muted); }
.specimen .mono { --ds-typeface-regular: var(--ds-typeface-mono); font-variant-numeric: tabular-nums; }
.specimen .value { width: calc(4 * var(--cell)); text-align: right; }
.specimen .mark { display: inline-flex; align-items: flex-end; width: var(--cell); height: var(--ds-control-height); flex: 0 0 var(--cell); }
.specimen .columns { display: flex; flex-wrap: wrap; gap: var(--cell); }
.specimen .columns > * { min-width: 0; }
.specimen fieldset { border: 0; padding: 0; margin: 0; }
.specimen legend { padding: 0; }
.specimen label { display: flex; align-items: flex-end; gap: calc(var(--cell) / 2); min-height: var(--cell); }
.specimen ds-panel { height: calc(10 * var(--cell)); }
</style> Try it
Section titled “Try it”Its name, a title and a picture that runs off the foot. With href the whole card is one link.
<ds-card href="#lists" tone="sharp-blue" width="14" height="18" media="center">
<span slot="label">Lists</span>
<span slot="title">Everything on one grid</span>
<span slot="media" style="display:block;width:calc(var(--ds-unit) * 10);height:calc(var(--ds-unit) * 10);border-radius:var(--ds-radius);background:var(--ds-zenith-blue)"></span>
</ds-card> variant="outlined" draws a 1px line and no fill.
<ds-card variant="outlined" width="16">
<span slot="title">Plans</span>
<ds-text literal wrap>Start free. Upgrade when you need more room.</ds-text>
<ds-button primary>Continue</ds-button>
</ds-card> Use it
Section titled “Use it”<ds-card href="/lists" tone="sharp-blue" width="14" height="22" media="center"> <span slot="label">Lists</span> <span slot="title">Everything on one grid</span> <img slot="media" src="lists.webp" alt="A list on a phone" /></ds-card>| Attribute | What it does |
|---|---|
href | The whole card is one link. |
interactive | The whole card is one press target that fires ds-card-press; use href for a destination. |
tone | A palette colour for the fill (sharp-blue, apple-green, pink, orange…), drawn as its pastel and dim in dark mode, or ink for the ink with the paper’s words. The quiet fill by default. |
variant | filled (the default) or outlined, a 1px line and no fill. |
width, height | The size in whole squares. |
padding | none, small (half a square), medium (one, the default) or large (two). |
media | Where the picture stands: start, center or bleed (on to the end edge and down to the foot, its corners there the card’s). |
disabled | Neither pressed nor followed. |
| Slot | Holds |
|---|---|
label | The thing’s name, muted, on one square. |
title | The title in the display size, a square and a half a line, so a title that wraps stays together. |
| (default) | Writing, one square a line. |
media | A picture, a square below the words. |
The corners are a card’s (--ds-radius-card, 4px by default); a product sets --ds-card-corner-size for rounder ones.
Accessibility
Section titled “Accessibility”- A card with
hrefis one link and a card withinteractiveone button: never put a second link or button inside either. Keyboard focus rings it 2px inside. - The pointer tints the card; nothing in it moves.