Outlined
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
Raised
Lifted off the page
Filled
Blends into a section
Featured
The one to notice
<Card variant="raised" eyebrow="Raised" title="Lifted off the page">
A soft shadow.
</Card>Patterns
Basic
Media
An image on top
Stat
Contrast checks
26passing, light and dark
Action
The whole card is a link
<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
Compact
Tighter
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.
Wide
Image beside the text
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.
New
One core, any skin
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
| Prop | Takes | What it does |
|---|---|---|
variant | outlined, raised, filled, featured | The look. Default outlined. |
size | comfortable, compact | The padding and title size. Default comfortable. |
eyebrow | text | A small label above the title. |
title | text | The card heading. |
titleAs | h2 to h6 | Heading level, so it fits the page outline. Default h3. |
children | anything | The body. |
media | { src, alt } | An image on top. Always give alt text. |
stat, statLabel | text | A big number and what it means. |
href | link | Makes the whole card one link. Do not combine with actions. |
actions | buttons | Buttons along the bottom. |
Accessibility
- Each card is an article with a real heading, so screen readers can jump card to card.
- A linked card has one link, not a pile of them. The focus ring wraps the whole card.
- Images need alt text. Use empty alt only for pure decoration.
- Hover lift turns instant when the visitor asks for less motion.
- In Windows high contrast mode, the card edge stays visible.