Card

A container for one idea: a title, a few lines, and maybe an image, a number, or an action. Built once, it reads only tokens and takes its look from whatever theme the app gives it. Switch the theme at the top and watch every card follow.

Variants

Outlined

The quiet default

A thin border. Use it for most cards.

Raised

Lifted off the page

A soft shadow. Use it when a card needs a little more weight.

Filled

Blends into a section

A soft fill, no border. Good for groups of cards on a busy page.
<Card variant="raised" eyebrow="Raised" title="Lifted off the page">
  A soft shadow.
</Card>

Patterns

Basic

A title, a few lines, and optional buttons.
Gray hills under a pale sun

Media

An image on top

The image keeps a 16 to 9 frame, so a row of cards lines up.

Stat

Contrast checks

26passing, light and dark

A big number and what it means, for dashboards and summaries.
<Card title="Contrast checks" stat="26" statLabel="passing, light and dark" />

<Card href="/rooms/core-tokens/" title="The whole card is a link">
  One link to tab to.
</Card>

Sizes

Comfortable

Room to breathe

The default. For pages people read.

Compact

Tighter

For dense lists and dashboards.

Responsive by its own width

The card reads its own width, not the screen's. Give it room and the image moves beside the text. Squeeze it into a sidebar and it tightens up. Same card, any layout.

Gray hills under a pale sun

Wide

Image beside the text

At 560 pixels wide and up, a media card turns sideways. On a phone it stacks again.

Build it, then take it anywhere

Pick the look, write the words, and choose the code you need: plain HTML for any site, React, Vue, Svelte, a Shopify section, or a WordPress pattern. Every format uses the same styles, so the card looks the same wherever it lands.

Preview width
Gray hills under a pale sun

New

One core, any skin

A content card themed by your tokens. Change anything on the left.

The preview widths show the card responding to its own space: stacked when narrow, image beside text when wide.

Code

ReadyAny website, Square, Webflow, Wix embeds, plain hosting.

<link rel="stylesheet" href="tokens.css">
<link rel="stylesheet" href="card.css">

<article class="prism-card prism-card--raised prism-card--comfortable prism-card--has-media">
  <div class="prism-card__inner">
    <div class="prism-card__media">
      <img src="your-image.jpg" alt="Describe the image" width="640" height="360" loading="lazy">
    </div>
    <div class="prism-card__body">
      <p class="prism-card__eyebrow">New</p>
      <h3 class="prism-card__title">One core, any skin</h3>
      <div class="prism-card__content">A content card themed by your tokens. Change anything on the left.</div>
    </div>
  </div>
</article>

Props

PropTakesWhat it does
variantoutlined, raised, filled, featuredThe look. Default outlined.
sizecomfortable, compactThe padding and title size. Default comfortable.
eyebrowtextA small label above the title.
titletextThe card heading.
titleAsh2 to h6Heading level, so it fits the page outline. Default h3.
childrenanythingThe body.
media{ src, alt }An image on top. Always give alt text.
stat, statLabeltextA big number and what it means.
hreflinkMakes the whole card one link. Do not combine with actions.
actionsbuttonsButtons along the bottom.

Accessibility