Display
Card
White surface with a 28px radius that groups one topic, such as a product on the dashboard. Statix separates cards from the page by fill, so they have no border by default.
import * as Card from '@statix/ui/card';Playground
3 websites, WordPress hosting
Pick a website to open its content, backups and settings.
<Card.Root>
<Card.Header>
<Card.Title>Websites</Card.Title>
<Card.Description>3 websites, WordPress hosting</Card.Description>
</Card.Header>
<Card.Content>
<p>Pick a website to open its content, backups and settings.</p>
</Card.Content>
<Card.Footer>
<Button variant="dark" size="sm">Go to your websites</Button>
</Card.Footer>
</Card.Root>Examples
Basic
Header with title and description, content and a footer.
yoga-berger.de is backed up every night. We keep 30 days.
Restoring takes about five minutes. Nothing changes until you confirm.
<script lang="ts">
import * as Card from '@statix/ui/card';
import { Button } from '@statix/ui/button';
</script>
<Card.Root class="w-full max-w-md">
<Card.Header>
<Card.Title>Last backup today at 03:10</Card.Title>
<Card.Description>yoga-berger.de is backed up every night. We keep 30 days.</Card.Description>
</Card.Header>
<Card.Content>
<p>Restoring takes about five minutes. Nothing changes until you confirm.</p>
</Card.Content>
<Card.Footer class="gap-2">
<Button variant="dark">Restore website</Button>
<Button variant="ghost">View all backups</Button>
</Card.Footer>
</Card.Root>Dashboard tiles
The start page pattern: an icon circle, title and summary, and a footer link. One card in the grid takes a tone to mark the main product.
3 websites · WordPress hosting
Pick a website to open its content, backups and settings.
<script lang="ts">
import * as Card from '@statix/ui/card';
import ArrowRightIcon from '@lucide/svelte/icons/arrow-right';
import LayoutGridIcon from '@lucide/svelte/icons/layout-grid';
import MailIcon from '@lucide/svelte/icons/mail';
</script>
<div class="grid w-full gap-6 tablet:grid-cols-2">
<Card.Root tone="navy">
<Card.Header class="grid-cols-[auto_1fr] gap-x-5">
<span class="row-span-2 flex size-12 items-center justify-center rounded-full bg-white/15">
<LayoutGridIcon class="size-5" />
</span>
<Card.Title>Websites</Card.Title>
<Card.Description class="font-medium text-white"
>3 websites · WordPress hosting</Card.Description
>
</Card.Header>
<Card.Content>
<p>Pick a website to open its content, backups and settings.</p>
</Card.Content>
<Card.Footer class="mt-auto">
<a href="#websites" class="flex w-full items-center justify-between font-medium">
Go to your websites
<ArrowRightIcon class="size-5" />
</a>
</Card.Footer>
</Card.Root>
<Card.Root>
<Card.Header class="grid-cols-[auto_1fr] gap-x-5">
<span class="row-span-2 flex size-12 items-center justify-center rounded-full bg-secondary">
<MailIcon class="size-5" />
</span>
<Card.Title>Email</Card.Title>
<Card.Description class="font-medium text-ink">5 mailboxes · 2 forwards</Card.Description>
</Card.Header>
<Card.Content class="text-ink-2">
<p>Read email, set up devices or add another address.</p>
</Card.Content>
<Card.Footer class="mt-auto">
<a href="#mailboxes" class="flex w-full items-center justify-between font-medium">
Choose a mailbox
<ArrowRightIcon class="size-5" />
</a>
</Card.Footer>
</Card.Root>
</div>Tones
navy, plum, moss, clay and slate carry white text. Description and footer text switch to white automatically.
3 websites
5 mailboxes
All up to date
6 domains
1 open
<script lang="ts">
import * as Card from '@statix/ui/card';
const tones = [
{ tone: 'navy', title: 'Websites', text: '3 websites' },
{ tone: 'plum', title: 'Email', text: '5 mailboxes' },
{ tone: 'moss', title: 'Backups', text: 'All up to date' },
{ tone: 'clay', title: 'Domains', text: '6 domains' },
{ tone: 'slate', title: 'Invoices', text: '1 open' }
] as const;
</script>
<div class="grid w-full gap-4 sm:grid-cols-2 lg:grid-cols-5">
{#each tones as item (item.tone)}
<Card.Root tone={item.tone} size="sm">
<Card.Header>
<Card.Title>{item.title}</Card.Title>
<Card.Description>{item.text}</Card.Description>
</Card.Header>
</Card.Root>
{/each}
</div>With an action
Card.Action sits top right in the header, next to title and description.
6 domains. The next renewal is on 14 January 2027.
yoga-berger.de, yoga-berger.com, berger-yoga.de and 3 more.
<script lang="ts">
import * as Card from '@statix/ui/card';
import { Button } from '@statix/ui/button';
import PlusIcon from '@lucide/svelte/icons/plus';
</script>
<Card.Root class="w-full max-w-lg">
<Card.Header>
<Card.Title>Domains</Card.Title>
<Card.Description>6 domains. The next renewal is on 14 January 2027.</Card.Description>
<Card.Action>
<Button variant="outline" size="sm">
<PlusIcon data-icon="inline-start" />
Add domain
</Button>
</Card.Action>
</Card.Header>
<Card.Content>
<p class="text-ink-2">yoga-berger.de, yoga-berger.com, berger-yoga.de and 3 more.</p>
</Card.Content>
</Card.Root>Outline
On a white surface a fill does not separate, so use the outline variant or secondary for a quiet bg-2 panel.
4.6 of 5 GB used in info@yoga-berger.de
WordPress Hosting M, renews monthly
<script lang="ts">
import * as Card from '@statix/ui/card';
</script>
<div class="grid w-full max-w-2xl gap-4 sm:grid-cols-2">
<Card.Root variant="outline" size="sm">
<Card.Header>
<Card.Title>Mailbox storage</Card.Title>
<Card.Description>4.6 of 5 GB used in info@yoga-berger.de</Card.Description>
</Card.Header>
</Card.Root>
<Card.Root variant="secondary" size="sm">
<Card.Header>
<Card.Title>Contract</Card.Title>
<Card.Description>WordPress Hosting M, renews monthly</Card.Description>
</Card.Header>
</Card.Root>
</div>Small
size="sm" drops the inner spacing to 20px and the title to subtitle size.
€24.90, paid on 3 November 2026
<script lang="ts">
import * as Card from '@statix/ui/card';
import { Button } from '@statix/ui/button';
</script>
<Card.Root size="sm" class="w-full max-w-xs">
<Card.Header>
<Card.Title>Invoice RE-2026-0142</Card.Title>
<Card.Description>€24.90, paid on 3 November 2026</Card.Description>
</Card.Header>
<Card.Footer>
<Button variant="secondary" size="sm">Download PDF</Button>
</Card.Footer>
</Card.Root>Guidelines
Do
- Put cards on the page background (bg). The white fill is the separation.
- Use one tone card per grid to mark the main product or the next step.
- End a card with a footer link that says where it goes: "Go to your websites".
Don't
- Don’t add shadows or borders to cards on the page background.
- Don’t nest cards. Inside a card, use rounded-lg tiles on bg-2 or Item rows.
- Don’t use more than one tone in the same grid.
Accessibility
- Card renders plain <div> elements with no role. If the card is a landmark-worthy region, pass role="region" and aria-labelledby pointing at the title.
- Card.Title is a <div>. Wrap its text in a heading (<h2>, <h3>) that fits the page outline.
- Make the whole card clickable only with a real link inside it; don’t put onclick on the card.
- Tone fills meet 4.5:1 with white text. Keep secondary text at white/80 or brighter.
API reference
Card.Root
renders<div> and accepts its attributes| Prop | Type | Default |
|---|---|---|
variant | 'default' | 'outline' | 'secondary' default is the white card. outline adds a hairline. secondary is a bg-2 panel. | 'default' |
tone | 'navy' | 'plum' | 'moss' | 'clay' | 'slate' Tone fill with white text. Overrides the variant fill. | – |
size | 'default' | 'sm' Inner spacing: 28px or 20px. Sets --card-spacing for all parts. | 'default' |
ref bind | HTMLDivElement | null The rendered element. | – |
class | ClassValue Merged with the variant classes; yours win. | – |
| Data attribute | Meaning |
|---|---|
data-slot="card" | Always present. |
data-variant | The current variant. |
data-tone | Present on tone cards. Parts use it to switch text to white. |
data-size | default or sm. |
Card.Header
renders<div> and accepts its attributesGrid for title, description and action. Add class="border-b" for a divider.
| Data attribute | Meaning |
|---|---|
data-slot="card-header" | Always present. |
Card.Title
renders<div> and accepts its attributestext-title (24/600), text-subtitle in small cards.
| Data attribute | Meaning |
|---|---|
data-slot="card-title" | Always present. |
Card.Description
renders<p> and accepts its attributestext-body in ink-2, white/80 on tone cards.
| Data attribute | Meaning |
|---|---|
data-slot="card-description" | Always present. |
Card.Action
renders<div> and accepts its attributesTop-right slot in the header for a button or menu.
| Data attribute | Meaning |
|---|---|
data-slot="card-action" | Always present. |
Card.Content
renders<div> and accepts its attributesMain area with horizontal card padding.
| Data attribute | Meaning |
|---|---|
data-slot="card-content" | Always present. |
Card.Footer
renders<div> and accepts its attributesRow for links and buttons. Add class="border-t" for a divider.
| Data attribute | Meaning |
|---|---|
data-slot="card-footer" | Always present. |
cardVariants
The tailwind-variants function behind Card.Root, for styling other elements as a card.