Android — Material 3
Pure CSS
Material cards
M3’s three card families — elevated with its shadow, filled with its tinted surface and outlined with its stroke — each with headline, supporting text and footer buttons, at the exact 12px radius.
Real scenarios
The component as it is used in a product — not a specimen grid.
Pick a playlist card
Same content, three containers: the elevated card floats on its shadow, the filled card rests on the highest tinted surface, and the outlined card keeps a quiet stroke. Hover the elevated one.
Albums of the year
24 fresh albums landed in your library this week.
Rainy-tea afternoons
Piano, tar and rain on the window — for slow evenings.
The road to the north
Made for the 6 a.m. bus to Hirkanic forests.
elevated
filled
outlined
All at the official 12 px radius; the media edge is clipped by the card itself.
Important props
| Prop | Type | Default | What it does |
|---|---|---|---|
| variant | string | 'elevated' | elevated · filled · outlined; show them side by side to choose. |
| --m3card-radius | length | '12px' | The official M3 card radius. |
| elevation | shadow | 'level1' | The elevated card’s shadow: 0 1px 2px at 30% and 15% alpha. |
Snippet
<article class="m3card" data-variant="elevated">
<h3>آلبومهای امسال</h3>
<p>۲۴ آلبوم تازه در کتابخانهٔ شما.</p>
<footer><button>گوش دادن</button></footer>
</article>
<style>
.m3card { inline-size: 340px; padding: 16px; border-radius: 12px; background: #F7F2FA; }
.m3card[data-variant='elevated'] { background: #FFF; box-shadow: 0 1px 2px #0000004d, 0 1px 3px 1px #00000026; }
.m3card[data-variant='outlined'] { background: #FFF; border: 1px solid #CAC4D0; }
</style>