Van KX-219
Brake pads at 3 mm on the front axle. Next service due in 1,800 km.
Use a card to summarize one object — a vehicle, a work order, a depot — in a grid or board, with a way to open it. Use a table when people compare many records field by field, and a list group for long single-column lists.
<a>.Content: title is the object's name ("Van KX-219"), meta is one line of facts, body is two lines at most. Write status in words ("Oil change overdue by 6 days"), not only with color.
<article class="card"> (or <li> in a list of cards) labelled by its title.card__media, bleeds to the edges, 16:9.card__header with .card__title (a heading) and .card__meta.card__body.card__actions / .card__footer, pinned to the bottom.card__link on the title; its ::after covers the card.card__select, label + native checkboxStates marked hover and focus-visible are frozen with .is-hover and .is-focus-visible. Those classes share their rule with the real pseudo-class; never use them in product code.
Cards in a grid stretch to equal height; actions pin to the bottom edge.
Brake pads at 3 mm on the front axle. Next service due in 1,800 km.
In the workshop since 07:40 for a gearbox oil leak.
11 h labour logged, parts ordered.
Scheduled for Thursday 10 Oct, 09:00.
Last service 14 Mar at 132,100 km.
Ready for dispatch.
<article class="card card--interactive" aria-labelledby="c3-t">
<header class="card__header">
<h4 id="c3-t" class="card__title"><a class="card__link" href="#card">WO-4185 · Gearbox oil leak</a></h4>
<p class="card__meta">Truck TR-077 · Idris Okafor</p>
</header>
<p class="card__body">11 h labour logged, parts ordered.</p>
</article>
<article class="card" aria-labelledby="c5-t">
<header class="card__header">
<h4 id="c5-t" class="card__title">Pickup PU-012</h4>
<p class="card__meta">Oil change overdue by 6 days</p>
</header>
<p class="card__body">Last service 14 Mar at 132,100 km.</p>
<div class="card__actions">
<button type="button" class="btn btn--primary btn--sm">Book service</button>
<button type="button" class="btn btn--ghost btn--sm">Snooze 7 days</button>
</div>
</article>
<article class="card card--selectable" aria-labelledby="c6-t">
<label class="card__select"><input type="checkbox" checked aria-labelledby="c6-t"> Selected</label>
<header class="card__header">
<h4 id="c6-t" class="card__title">Van KX-230</h4>
<p class="card__meta">Renault Master · 22,480 km</p>
</header>
<p class="card__body">Ready for dispatch.</p>
</article>
| Hook | Values | Purpose |
|---|---|---|
.card | block class | Raised surface, border, 12px radius, padding from --card-padding |
.card--interactive | modifier class | Hover elevation; focus ring drawn around the card when the link has focus |
.card--selectable | modifier class | Selected styling when the inner checkbox is :checked |
.card__media | __header | __title | __meta | __body | __actions | __footer | part classes | Content slots |
.card__link | part class | The single primary link; stretched over the card |
.card__select | part class | Checkbox row; sits above the stretched link |
.is-hover | .is-focus-visible | docs-only class | Freeze hover (on the card) or focus (on the link) |
Title link "WO-4185 · Gearbox oil leak" + separate "Book service" button.
<a href><article>…<button>
"Oil change overdue by 6 days"
A red top border and no text.
| Key | Behavior |
|---|---|
| Tab | Moves to the card link, then to each action button or the checkbox |
| Enter | Follows the card link |
| Space | Toggles the select checkbox |
<article> named by its title via aria-labelledby. In a grid of cards use <ul role="list"><li>.::after enlarges the hit area without changing the name.:has(:focus-visible)).CanvasText; selected border becomes a 2px Highlight.| Custom property | Purpose |
|---|---|
--card-radius | --card-padding | --card-shadow | Shape, inner spacing, resting shadow |
--elevation-raised | Hover shadow of interactive cards |
--color-elevation-surface-raised | -sunken | Card surface, media well |
--color-border-default | -strong | Resting and hover border |
--color-selected-border | Selected border |
--typography-h5-* | Title |
--z-raised | Actions above the stretched link |
--motion-duration-fast | Shadow and border transition |