Skip to content

Card

A frame around content that belongs together, such as one case in a list of cases. The card is a container, not a component with behaviour: the content decides what the user can do.

data-variantUsed for
(omitted)Outline on the page surface. The default.
filledMuted surface, when the card should stand out from white without a border

data-interactive gives hover and a focus indicator, but makes nothing clickable on its own. The element has to be an <a> or a <button>. A <div> with a click listener can neither be reached with the keyboard nor be announced as something to press.

If the card has several actions, the whole card should not be a link. The buttons then end up inside a link, and the user cannot press them without navigating. Make one clear link in the heading instead.

ClassWhat it is
.lt-cardThe card itself. The variant comes from data-variant.
.lt-card__titleThe heading inside the card
VariableDefault
--lt-card-paddingvar(--lt-spacing-4)
--lt-card-radiusvar(--lt-spacing-2)

An example. A card that carries a whole section can take more space than one in a list:

See Customising for how the variables and the layer work.

  • The heading in the card should be a real heading element, at the right level for the page. The class sets the size, weight and line height, not the level.
  • If the cards are a list, mark them up as a list with <ul> and <li>. The screen reader then says how many there are and where in the list the user is.
  • Do not hide important information behind hover. It does not exist on a touch screen.
  • The order in the markup is the order the keyboard follows. Moving something visually with CSS does not move focus.