Card

A padded surface with a shadow. The classless build styles every article this way; .card in 1.x meant the bordered variant, which is now .card-border.

ClassDoes what
cardPadded, raised surface with a shadow
card-borderFlat surface with a border instead of a shadow
card-actionsFooter row: top border, right-aligned actions

Basic

<article class="card prose">
  <h3>Card heading</h3>
  <p>Cards hold a block of related content.</p>
</article>

With a footer

<article class="card prose">
  <h3>Delete this project?</h3>
  <p>This cannot be undone.</p>
  <footer class="card-actions flex" style="justify-content: end">
    <button class="btn btn-secondary">Cancel</button>
    <button class="btn">Delete</button>
  </footer>
</article>

Bordered

<div class="card-border prose">
  <h3>Bordered</h3>
  <p>A border instead of a shadow, on the page background.</p>
</div>

In 1.x, .card was the bordered variant. Both builds now share one set of class names, so .card is the base card and the bordered one is .card-border.

Composition

Common ways to put this together with other components. The general rules are on Composition.

A grid of equal cards and a call to action

Several offers of equal weight, then one card that asks for the next step.

Same markup in both builds
<section class="prose">
  <h2>Services</h2>
  <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: var(--padding); margin-bottom: 1rem">
    <article class="card"><h3>First service</h3><p>What it is, in a line.</p></article>
    <article class="card"><h3>Second service</h3><p>What it is, in a line.</p></article>
    <article class="card"><h3>Third service</h3><p>What it is, in a line.</p></article>
  </div>
  <article class="card" style="text-align: center">
    <p>Not sure which fits?</p>
    <a href="#" class="btn">Talk it through</a>
  </article>
</section>

Bordered items in a raised card

A card holding a few bordered blocks: the blocks drop back to the page colour, which separates them without a second shadow.

Same markup in both builds
<article class="card prose">
  <h3>Downloads</h3>
  <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: var(--padding)">
    <div class="card-border"><strong>Logo</strong><p class="flex"><a href="#" class="link">SVG</a> <a href="#" class="link">PNG</a></p></div>
    <div class="card-border"><strong>Flyer</strong><p class="flex"><a href="#" class="link">PDF</a></p></div>
  </div>
</article>

A list of linked entries

Each entry is one link: an image beside its title and a sentence.

Same markup in both builds
<div style="display: grid; gap: var(--padding)">
  <a href="#" class="semantic card flex flip" style="align-items: center">
    <div style="width: 10rem; flex-shrink: 0; aspect-ratio: 1.5; border-radius: var(--border-radius); background: var(--fill-strong)"></div>
    <div class="prose"><h3 class="link">Entry title</h3><p>A sentence or two about it.</p></div>
  </a>
  <a href="#" class="semantic card flex flip" style="align-items: center">
    <div style="width: 10rem; flex-shrink: 0; aspect-ratio: 1.5; border-radius: var(--border-radius); background: var(--fill-strong)"></div>
    <div class="prose"><h3 class="link">Another entry</h3><p>A sentence or two about it.</p></div>
  </a>
</div>

Work in progress

A card that reports progress, with a way out.

Same markup in both builds
<article class="card">
  <div class="flex" style="justify-content: space-between">
    <strong>Uploading photos</strong>
    <span class="text-secondary">7 of 12</span>
  </div>
  <progress class="progress" value="7" max="12" style="margin: calc(var(--padding) / 2) 0"></progress>
  <footer class="card-actions flex" style="justify-content: end">
    <button class="btn btn-secondary">Cancel</button>
  </footer>
</article>

Loading

While a grid of cards loads, each card shows blocks where its content will be.

Same markup in both builds
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: var(--padding)" aria-busy="true">
  <div class="card">
    <div class="skeleton" style="aspect-ratio: 1.5; margin-bottom: calc(var(--padding) / 2)"></div>
    <div class="skeleton" style="height: 1.2rem; width: 70%; margin-bottom: calc(var(--padding) / 4)"></div>
    <div class="skeleton" style="height: 1rem"></div>
  </div>
  <div class="card">
    <div class="skeleton" style="aspect-ratio: 1.5; margin-bottom: calc(var(--padding) / 2)"></div>
    <div class="skeleton" style="height: 1.2rem; width: 55%; margin-bottom: calc(var(--padding) / 4)"></div>
    <div class="skeleton" style="height: 1rem"></div>
  </div>
</div>