Skip to content
Style Guide
v0.1.0

Components

Cards

A bordered surface that groups related content. In a monochrome system a card's edge is doing real work, so the border is the default and the shadow is the exception.

The default card

A 1px border, a 12px radius, and 24px of padding. No shadow — separation comes from the edge, which suits a flat, geometric brand and stays legible in both themes.

Living room

Ceiling light

On since 14:20 · 8.5 W

Kitchen

Smart plug

Offline since yesterday

Cards in a grid

The footer uses margin-block-start: auto, so in a grid of cards of different heights every footer still lines up along the bottom.

Parts and variants

ClassPurpose
.tmt-cardThe surface. A flex column with the border and radius.
.tmt-card__mediaAn image at the top, 16:9, cropped to fill.
.tmt-card__bodyThe content, 24px padded, 8px between children.
.tmt-card__footerActions, pinned to the bottom.
.tmt-card--raisedDrops the border for a shadow. For something that genuinely floats.
.tmt-card--inverseBlack surface, white text. For a feature or hero card.
.tmt-card--linkMakes the whole card a click target. See below.

Clickable cards

Making a whole card clickable is easy to get wrong. Wrapping everything in an <a> gives a screen reader user one enormous link that reads the entire card as its name, and it makes any nested button unreachable.

The system uses the "pseudo-element overlay" approach instead: one real link on the title, stretched to cover the card. The link's accessible name is just the title, the focus ring is drawn around the whole card, and the card's text stays selectable.

Clickable card
A clickable card can hold exactly one link. A second interactive element would sit under the overlay and be unreachable. If a card needs a link and a button, do not use --link — make the title a normal link and leave the rest of the card inert.

Inverse and pattern cards

A black card is the strongest emphasis available in a monochrome system. Use one per screen at most — two black cards side by side cancel each other out.

This month

128 kWh

14% less than last month.

Inverse card with pattern

What goes in a card

  • One idea. A card that needs a scrollbar or a tab strip is a page.
  • A title, in a real heading where the card is part of a list of things — the headings are how a screen reader user moves between them. Use the .tmt-h4 class on whatever heading level fits the page's outline.
  • At most two actions, in the footer.
  • Equal information across a set. Cards in a grid are compared to each other; one card with an extra line of metadata reads as more important than it is.

Do

  • Use the border, not a shadow, unless the card really floats.
  • Keep padding at 24px so cards match across products.
  • Let the grid decide the number of columns.

Don't

  • Nest a card inside a card.
  • Put two interactive elements in a --link card.
  • Fix a card's height and let the content clip.
  • Use a card as a decorative box around a single sentence.