Card
MD3 card — elevated, filled, or outlined.
Walkthrough
1. Basic
Header, body, footer. The body is the part that grows, so a row of cards with different amounts to say still lines its footers up.
Invoice #4021
Due in 14 days
<script lang="ts"> import { Button, Card, CardContent, CardFooter, CardHeader } from 'omaris';</script><Card class="w-80 max-w-full"> <CardHeader heading="Invoice #4021" description="Due in 14 days" /> <CardContent>Kurdistan Coffee Roasters — 24 kg green Arabica, delivered 3 March.</CardContent> <CardFooter> <Button variant="text">Dismiss</Button> <Button>Pay now</Button> </CardFooter></Card> 2. Variants
outlined is the default. elevated lifts — a grid of cards on a page wants it; filled sits in a tinted well, for a card inside another surface.
elevated
filled
outlined
<script lang="ts"> import { Card, CardContent, CardHeader } from 'omaris';</script><Card variant="elevated" class="w-56 max-w-full"> <CardHeader heading="elevated" /> <CardContent>The same card, three surfaces.</CardContent></Card><Card variant="filled" class="w-56 max-w-full"> <CardHeader heading="filled" /> <CardContent>The same card, three surfaces.</CardContent></Card><Card variant="outlined" class="w-56 max-w-full"> <CardHeader heading="outlined" /> <CardContent>The same card, three surfaces.</CardContent></Card> 3. With media
bleed cancels the card's padding so the picture reaches the edges, and rounds only the corners it actually touches.
Erbil citadel
Six thousand years, still occupied
<script lang="ts"> import { Card, CardContent, CardHeader, CardMedia } from 'omaris';</script><Card variant="elevated" class="w-72 max-w-full"> <CardMedia ratio="16/9"> <div class="size-full bg-linear-to-br from-primary-container to-tertiary-container" aria-hidden="true" ></div> </CardMedia> <CardHeader heading="Erbil citadel" description="Six thousand years, still occupied" /> <CardContent>One of the longest continuously inhabited sites on earth.</CardContent></Card> 4. Interactive
A picker — plans, delivery options. interactive makes the whole card pressable, with a ripple, and selected marks the chosen one.
Standard
3–5 days
Express
Next day
<script lang="ts"> import { Card, CardContent, CardHeader } from 'omaris'; let chosen = $state('standard');</script><Card interactive selected={chosen === 'standard'} class="w-52 max-w-full" onclick={() => (chosen = 'standard')} aria-pressed={chosen === 'standard'}> <CardHeader heading="Standard" description="3–5 days" /> <CardContent>Delivered by our own drivers.</CardContent></Card><Card interactive selected={chosen === 'express'} class="w-52 max-w-full" onclick={() => (chosen = 'express')} aria-pressed={chosen === 'express'}> <CardHeader heading="Express" description="Next day" /> <CardContent>Delivered by our own drivers.</CardContent></Card> 5. Nested actions
A pressable card that holds its own buttons. The heart takes its own press; anywhere else opens the listing.
Courtyard house
Opened 0 times
<script lang="ts"> import { Card, CardContent, IconButton, Text } from 'omaris'; let saved = $state(false); let opened = $state(0);</script><Card interactive class="w-64 max-w-full p-0" onclick={() => opened++}> <div class="relative aspect-[4/3] rounded-t-[inherit] bg-tertiary-container"> <IconButton variant="filled" size="xs" class="absolute end-2 top-2" aria-label={saved ? 'Unsave' : 'Save'} aria-pressed={saved} onclick={() => (saved = !saved)} > <svg viewBox="0 0 24 24" class={saved ? 'fill-current' : 'fill-none'} stroke="currentColor"> <path d="M12 20s-7-4.4-7-10a4 4 0 0 1 7-2.6A4 4 0 0 1 19 10c0 5.6-7 10-7 10Z" stroke-width="2" stroke-linejoin="round" /> </svg> </IconButton> </div> <CardContent class="flex flex-col gap-1 p-3"> <Text variant="title-sm">Courtyard house</Text> <Text variant="body-sm" tone="muted">Opened {opened} {opened === 1 ? 'time' : 'times'}</Text> </CardContent></Card> 6. Glass
The glass look. Inside data-translucent a card is a slab of the wallpaper, and a pressable one gives under the finger: press it, drag it, let go.
Standard
3–5 days
Express
Next day
Your basket
2 items
<script lang="ts"> import { Button, Card, CardContent, CardFooter, CardHeader } from 'omaris'; let chosen = $state('standard');</script><div data-translucent class="grid w-full gap-4 rounded-shape-xl wallpaper p-5 sm:grid-cols-2"> <Card interactive selected={chosen === 'standard'} onclick={() => (chosen = 'standard')} aria-pressed={chosen === 'standard'} > <CardHeader heading="Standard" description="3–5 days" /> <CardContent>Delivered by our own drivers.</CardContent> </Card> <Card interactive selected={chosen === 'express'} onclick={() => (chosen = 'express')} aria-pressed={chosen === 'express'} > <CardHeader heading="Express" description="Next day" /> <CardContent>Delivered by our own drivers.</CardContent> </Card> <Card class="sm:col-span-2"> <CardHeader heading="Your basket" description="2 items" /> <CardFooter> <Button variant="tonal">Review</Button> <Button>Check out</Button> </CardFooter> </Card></div> 7. Header slots
start and end take an avatar, a badge, a menu button — anything. The header of a card about a person, or a record with a status.
Omer Chetin
Opened this pull request
<script lang="ts"> import { Avatar, Badge, Card, CardContent, CardHeader, IconButton } from 'omaris';</script><Card class="w-full max-w-96"> <CardHeader heading="Omer Chetin" description="Opened this pull request"> {#snippet start()} <Avatar name="Omer Chetin" /> {/snippet} {#snippet end()} <div class="flex items-center gap-2"> <Badge tone="success" variant="tonal">Open</Badge> <IconButton aria-label="More actions" size="sm"> <svg viewBox="0 0 24 24" fill="currentColor"> <circle cx="12" cy="5" r="1.6" /><circle cx="12" cy="12" r="1.6" /><circle cx="12" cy="19" r="1.6" /> </svg> </IconButton> </div> {/snippet} </CardHeader> <CardContent>Adds the docs site and moves Storybook to /storybook.</CardContent></Card> 8. Overridden
A footer defaults to putting its actions at the end, which MD3 asks for. align moves them, and class on the card wins over its own padding.
Storage
8.2 GB of 10 GB used
<script lang="ts"> import { Button, Card, CardContent, CardFooter, CardHeader } from 'omaris';</script><Card class="w-full max-w-96 rounded-shape-2xl"> <CardHeader heading="Storage" description="8.2 GB of 10 GB used" /> <CardContent>Older exports are removed automatically after 90 days.</CardContent> <CardFooter align="between"> <Button variant="text" tone="destructive">Delete all</Button> <Button variant="tonal">Upgrade</Button> </CardFooter></Card>