Skip to content
Fleetline

Card

Usage

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.

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.

Anatomy

  1. Container — <article class="card"> (or <li> in a list of cards) labelled by its title
  2. Media (optional) — .card__media, bleeds to the edges, 16:9
  3. Header — .card__header with .card__title (a heading) and .card__meta
  4. Body — .card__body
  5. Actions or footer (optional) — .card__actions / .card__footer, pinned to the bottom
  6. Primary link (interactive) — .card__link on the title; its ::after covers the card
  7. Select (selectable) — .card__select, label + native checkbox

Examples

States 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.

Card

Cards in a grid stretch to equal height; actions pin to the bottom edge.

Van KX-219

Ford Transit · 84,212 km

Brake pads at 3 mm on the front axle. Next service due in 1,800 km.

Truck TR-077

Volvo FH · depot north

In the workshop since 07:40 for a gearbox oil leak.

Pickup PU-012

Oil change overdue by 6 days

Last service 14 Mar at 132,100 km.

Van KX-230

Renault Master · 22,480 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>

API

HookValuesPurpose
.cardblock classRaised surface, border, 12px radius, padding from --card-padding
.card--interactivemodifier classHover elevation; focus ring drawn around the card when the link has focus
.card--selectablemodifier classSelected styling when the inner checkbox is :checked
.card__media | __header | __title | __meta | __body | __actions | __footerpart classesContent slots
.card__linkpart classThe single primary link; stretched over the card
.card__selectpart classCheckbox row; sits above the stretched link
.is-hover | .is-focus-visibledocs-only classFreeze hover (on the card) or focus (on the link)

Do and don't

Title link "WO-4185 · Gearbox oil leak" + separate "Book service" button.

Do use one primary link and keep secondary buttons as separate controls.

<a href><article>…<button>

Don’t wrap the whole card in a link; buttons inside become unreachable and the link name becomes the entire card.

"Oil change overdue by 6 days"

Do state status in words, with numbers.

A red top border and no text.

Don’t rely on a colored edge to mean overdue.

Accessibility

Keyboard interaction
KeyBehavior
TabMoves to the card link, then to each action button or the checkbox
EnterFollows the card link
SpaceToggles the select checkbox

Tokens

Custom propertyPurpose
--card-radius | --card-padding | --card-shadowShape, inner spacing, resting shadow
--elevation-raisedHover shadow of interactive cards
--color-elevation-surface-raised | -sunkenCard surface, media well
--color-border-default | -strongResting and hover border
--color-selected-borderSelected border
--typography-h5-*Title
--z-raisedActions above the stretched link
--motion-duration-fastShadow and border transition