---
title: "Card"
description: "Card component - content containers with header, body, and footer sections."
slug: "card"
---

import { DocPage, PageHeader, SkillPanel, SourceFiles, SourceNote, StatesSection, CodeBlock, Demo, DemoCode, ChangelogEntries, ArchBody, StatsClaim, StatsCards, PageOverlay, DocText, DocLink, H2, SkillField, SkillText, SkillRow, SkillGrid, Variant, ApiPill, Dim, CodeCard, TableCard } from "../../lib/components/index";

<DocPage meta={meta}>

<PageHeader slug="card" title="Card" component="card">
  Content container with header, body, and footer regions. Use <code>&lt;div&gt;</code> for layout grouping or <code>&lt;article&gt;</code> for standalone content.
</PageHeader>

<SkillPanel component="card">
  <SkillField label="Native basis">
<SkillText><code>&lt;div&gt;</code> for layout grouping. <code>&lt;article&gt;</code> for standalone self-contained content.</SkillText>
  </SkillField>

  <SkillField label="Web Platform APIs">
<SkillRow>
    <ApiPill href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_containment/Container_queries" title="responsive layout based on card container width"><code>CSS Container Queries (@container)</code></ApiPill>
    <ApiPill href="https://developer.mozilla.org/en-US/docs/Web/CSS/aspect-ratio" title="intrinsic ratio for card media images"><code>aspect-ratio</code></ApiPill>
  </SkillRow>
  </SkillField>

  <SkillField label="Classes">
<SkillRow>
    <code>.card</code>
    <code>.card-header</code>
    <code>.card-title</code>
    <code>.card-description</code>
    <code>.card-content</code>
    <code>.card-footer</code>
    <code>.card-body</code>
    <code>.card-media</code>
  </SkillRow>
  </SkillField>

  <SkillField label="Data attributes (on .card)">
<SkillGrid>
    <Variant name="data-variant" description="outline, dashed, ghost, muted, elevated, primary, neutral (charcoal), glass" />
    <Variant name="data-size" description="xs, sm, md (default), lg, xl - padding and type scale together" />
    <Variant name="data-density" description="compact, comfortable (default), spacious - combines with data-size" />
    <Variant name="data-layout" description="side, auto (side while the card is wide enough), overlay (image as background)" />
    <Variant name="data-align" description="center - centered content and actions" />
    <Variant name="data-interactive / a.card" description="lifts on hover, focus ring" />
    <Variant name="label.card" description="selectable: a checked checkbox / radio inside rings the card" />
    <Variant name=".card-media[data-inset]" description="padded, rounded media instead of edge to edge" />
  </SkillGrid>
  </SkillField>

  <SkillField label="Notes">
<SkillText dense>• Card is a container pattern - its children define its purpose</SkillText>
  <SkillText dense>• Avoid deeply nesting cards (card inside card) - use <code>--muted</code> surface instead</SkillText>
  <SkillText dense>• For interactive cards (click to navigate), put the card classes on an <code>&lt;a&gt;</code> - it lifts on hover and shows a focus ring</SkillText>
  <SkillText dense>• On <code>primary</code> / <code>neutral</code> cards, use <code>secondary</code> or <code>outline</code> buttons - a default button matches the card surface</SkillText>
  <SkillText dense>• Shapes, frames, stacks and aura from <DocLink href="shapes.html">Shapes</DocLink> compose with any card</SkillText>
  <SkillText dense>• <code>card-footer</code> uses <code>padding-top: 0</code> to avoid double-spacing with <code>card-content</code></SkillText>
  <p class="text-muted-foreground m-0">• For a card grid, use CSS Grid on the parent - the card itself has no layout opinion</p>
  </SkillField>
</SkillPanel>

```html example label="Standard" hint="Header, content with form fields, and footer with actions." previewStyle="justify-content:center;"
<div class="card">
  <div class="card-header">
    <h3 class="card-title">Create project</h3>
    <p class="card-description">Deploy your new project in one click.</p>
  </div>
  <div class="card-content">
    <div style="display: flex; flex-direction: column; gap: 1rem">
      <div>
        <label class="label" for="name">Name</label>
        <input class="input" id="name" type="text" placeholder="My project" />
      </div>
      <div>
        <label class="label" for="desc">Description</label>
        <input class="input" id="desc" type="text" placeholder="Optional description" />
      </div>
    </div>
  </div>
  <div class="card-footer" style="justify-content: space-between">
    <button class="btn" data-variant="outline">Cancel</button>
    <button class="btn" data-variant="default">Deploy</button>
  </div>
</div>
```

```html example label="Metric" hint="Compact card for dashboard stats. Header row with icon." previewStyle="justify-content:center;"
<div class="card" style="max-width: 16rem; width: 100%">
  <div
    class="card-header"
    style="flex-direction: row; align-items: center; justify-content: space-between; padding-bottom: 0.5rem"
  >
    <p class="card-description" style="font-weight: 500; color: var(--foreground); font-size: 0.8125rem"
      >Total Revenue</p
    >
    <svg
      width="14"
      height="14"
      viewBox="0 0 24 24"
      fill="none"
      stroke="currentColor"
      stroke-width="2"
      stroke-linecap="round"
      stroke-linejoin="round"
      style="color: var(--muted-foreground)"
    >
      <path d="M12 2v20M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6" />
    </svg>
  </div>
  <div class="card-content" style="padding-top: 0.25rem">
    <p style="font-size: 1.625rem; font-weight: 700; margin: 0; letter-spacing: -0.025em">$45,231</p>
    <p class="card-description" style="font-size: 0.75rem; margin-top: 0.25rem">+20.1% from last month</p>
  </div>
</div>
```

```html example label="With Image" hint="Use &lt;article&gt; for standalone content. Image as first child." previewStyle="justify-content:center;"
<article class="card" style="max-width: 20rem; width: 100%">
  <img
    src="images/photos/x-1588345921523-c2dcdb7f1dcd-600x300.webp"
    alt="Abstract shapes"
    style="width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block"
  />
  <div class="card-header">
    <h3 class="card-title">Modern Design</h3>
    <p class="card-description">Exploring minimal aesthetics through form and color.</p>
  </div>
  <div class="card-content" style="padding-top: 0">
    <p style="margin: 0; font-size: 0.875rem; color: var(--muted-foreground); line-height: 1.6"
      >A deep dive into the principles that guide contemporary visual design.</p
    >
  </div>
  <div class="card-footer">
    <button class="btn" data-variant="default" data-size="sm">Read more</button>
    <button class="btn" data-variant="ghost" data-size="sm">Bookmark</button>
  </div>
</article>
```

```html example label="Header Action" hint="Action button in the header for settings or overflow menus." previewStyle="justify-content:center;"
<div class="card" style="max-width: 20rem; width: 100%">
  <div class="card-header" style="flex-direction: row; align-items: center; justify-content: space-between">
    <div>
      <h3 class="card-title">Team Members</h3>
      <p class="card-description">Manage who has access.</p>
    </div>
    <button class="btn" data-variant="ghost" data-size="icon" aria-label="More options">
      <svg
        aria-hidden="true"
        width="16"
        height="16"
        viewBox="0 0 24 24"
        fill="none"
        stroke="currentColor"
        stroke-width="2"
        stroke-linecap="round"
        stroke-linejoin="round"
      >
        <circle cx="12" cy="5" r="1" />
        <circle cx="12" cy="12" r="1" />
        <circle cx="12" cy="19" r="1" />
      </svg>
    </button>
  </div>
  <div class="card-content" style="display: flex; flex-direction: column; gap: 0.75rem">
    <div style="display: flex; align-items: center; gap: 0.75rem">
      <div
        style="
          width: 2rem;
          height: 2rem;
          border-radius: 9999px;
          background: var(--primary);
          display: flex;
          align-items: center;
          justify-content: center;
          font-size: 0.75rem;
          font-weight: 600;
          color: var(--primary-foreground);
          flex-shrink: 0;
        "
        >CL</div
      >
      <div>
        <p style="margin: 0; font-size: 0.875rem; font-weight: 500">Aron Homberg</p>
        <p style="margin: 0; font-size: 0.75rem; color: var(--muted-foreground)">Owner</p>
      </div>
    </div>
    <div style="display: flex; align-items: center; gap: 0.75rem">
      <div
        style="
          width: 2rem;
          height: 2rem;
          border-radius: 9999px;
          background: var(--secondary);
          display: flex;
          align-items: center;
          justify-content: center;
          font-size: 0.75rem;
          font-weight: 600;
          color: var(--secondary-foreground);
          flex-shrink: 0;
        "
        >JD</div
      >
      <div>
        <p style="margin: 0; font-size: 0.875rem; font-weight: 500">Jane Doe</p>
        <p style="margin: 0; font-size: 0.75rem; color: var(--muted-foreground)">Editor</p>
      </div>
    </div>
  </div>
  <div class="card-footer" style="padding-top: 1rem; border-top: 1px solid var(--border)">
    <button class="btn" data-variant="outline" data-size="sm" style="width: 100%"
      ><svg
        aria-hidden="true"
        width="14"
        height="14"
        viewBox="0 0 24 24"
        fill="none"
        stroke="currentColor"
        stroke-width="2"
        stroke-linecap="round"
        stroke-linejoin="round"
      >
        <path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" />
        <circle cx="9" cy="7" r="4" />
        <line x1="19" x2="19" y1="8" y2="14" />
        <line x1="22" x2="16" y1="11" y2="11" />
      </svg>
      Invite member
    </button>
  </div>
</div>
```

```html example label="Header Only" hint="A title + description panel with no content or footer: the header is the last section, so it keeps its bottom padding." previewStyle="justify-content:center;"
<div class="card" style="width: 100%; max-width: 24rem">
  <div class="card-header">
    <h3 class="card-title">Notifications</h3>
    <p class="card-description">You have 3 unread messages.</p>
  </div>
</div>
```

```html example label="Image overlay" hint="data-layout=&quot;overlay&quot;: the image is the background, the body sits on a dark scrim at the bottom, in white."
<article class="card" data-layout="overlay" style="max-width: 26rem">
  <figure class="card-media"
    ><img src="images/photos/x-1506905925346-21bda4d32df4-800x600.webp" alt="Mountain range at dawn"
  /></figure>
  <div class="card-body">
    <div class="card-header">
      <h3 class="card-title">Sunrise hike</h3>
      <p class="card-description">Leave at 4:30, summit by 6:10.</p>
    </div>
    <div class="card-footer"><button class="btn" data-variant="secondary" data-size="sm">Join</button></div>
  </div>
</article>
```

```html example label="Variants" hint="data-variant on the card: outline (no fill), dashed (a 2px dashed border - a drop zone or placeholder), ghost (no border, no fill), muted (a soft surface), elevated (a shadow instead of a border), primary and neutral (inverse) surfaces, and glass - frosted, over whatever is behind it."
<div class="grid grid-cols-auto gap-4 p-4 rounded-xl pattern-mesh" style="--layout-min: 13rem">
  <div class="card">
    <div class="card-header">
      <h3 class="card-title">Default</h3>
      <p class="card-description">Card surface, border.</p>
    </div>
  </div>
  <div class="card" data-variant="outline">
    <div class="card-header">
      <h3 class="card-title">Outline</h3>
      <p class="card-description">Border only, no fill.</p>
    </div>
  </div>
  <div class="card" data-variant="dashed">
    <div class="card-header">
      <h3 class="card-title">Dashed</h3>
      <p class="card-description">A drop zone or a placeholder.</p>
    </div>
  </div>
  <div class="card" data-variant="ghost">
    <div class="card-header">
      <h3 class="card-title">Ghost</h3>
      <p class="card-description">No border, no fill.</p>
    </div>
  </div>
  <div class="card" data-variant="muted">
    <div class="card-header">
      <h3 class="card-title">Muted</h3>
      <p class="card-description">A soft, borderless surface.</p>
    </div>
  </div>
  <div class="card" data-variant="elevated">
    <div class="card-header">
      <h3 class="card-title">Elevated</h3>
      <p class="card-description">A shadow instead of a border.</p>
    </div>
  </div>
  <div class="card" data-variant="primary">
    <div class="card-header">
      <h3 class="card-title">Primary</h3>
      <p class="card-description">The brand surface.</p>
    </div>
  </div>
  <div class="card" data-variant="neutral">
    <div class="card-header">
      <h3 class="card-title">Neutral</h3>
      <p class="card-description">The inverse surface.</p>
    </div>
  </div>
  <div class="card" data-variant="glass">
    <div class="card-header">
      <h3 class="card-title">Glass</h3>
      <p class="card-description">Frosted over the pattern behind it.</p>
    </div>
  </div>
</div>
```

```html example label="Sizes" hint="data-size scales padding and type together: xs, sm, md (the default), lg, xl. It combines with data-density, which scales only the whitespace."
<div class="flex flex-wrap items-start gap-4">
  <div class="card" data-size="xs" style="width: 10rem">
    <div class="card-header">
      <h3 class="card-title">Size xs</h3>
      <p class="card-description">Padding and type scale together.</p>
    </div>
    <div class="card-footer"><button class="btn" data-size="xs">Action</button></div>
  </div>
  <div class="card" data-size="sm" style="width: 12rem">
    <div class="card-header">
      <h3 class="card-title">Size sm</h3>
      <p class="card-description">Padding and type scale together.</p>
    </div>
    <div class="card-footer"><button class="btn" data-size="sm">Action</button></div>
  </div>
  <div class="card" data-size="md" style="width: 15rem">
    <div class="card-header">
      <h3 class="card-title">Size md</h3>
      <p class="card-description">Padding and type scale together.</p>
    </div>
    <div class="card-footer"><button class="btn" data-size="sm">Action</button></div>
  </div>
  <div class="card" data-size="lg" style="width: 18rem">
    <div class="card-header">
      <h3 class="card-title">Size lg</h3>
      <p class="card-description">Padding and type scale together.</p>
    </div>
    <div class="card-footer"><button class="btn" data-size="sm">Action</button></div>
  </div>
  <div class="card" data-size="xl" style="width: 21rem">
    <div class="card-header">
      <h3 class="card-title">Size xl</h3>
      <p class="card-description">Padding and type scale together.</p>
    </div>
    <div class="card-footer"><button class="btn" data-size="lg">Action</button></div>
  </div>
</div>
```

```html example label="Media" hint="A .card-media figure edge to edge - first for an image on top, last for one at the bottom. data-inset pads and rounds it; with data-align=&quot;center&quot; that is the centered product look."
<div class="grid grid-cols-auto gap-4" style="--layout-min: 15rem">
  <article class="card">
    <figure class="card-media"
      ><img src="images/photos/x-1506905925346-21bda4d32df4-600x400.webp" alt="Mountain range at dawn"
    /></figure>
    <div class="card-header">
      <h3 class="card-title">Image on top</h3>
      <p class="card-description">The first child, edge to edge.</p>
    </div>
    <div class="card-footer"><button class="btn" data-size="sm">Explore</button></div>
  </article>
  <article class="card">
    <div class="card-header">
      <h3 class="card-title">Image at the bottom</h3>
      <p class="card-description">The last child - content first.</p>
    </div>
    <div class="card-content" style="padding-bottom: 1rem"
      ><p class="text-sm m-0">Place the figure after the body.</p></div
    >
    <figure class="card-media"
      ><img src="images/photos/x-1469474968028-56623f02e42e-600x400.webp" alt="A lake between mountains"
    /></figure>
  </article>
  <article class="card" data-align="center">
    <figure class="card-media" data-inset
      ><img src="images/photos/x-1494548162494-384bba4ab999-600x400.webp" alt="Desert dunes"
    /></figure>
    <div class="card-header">
      <h3 class="card-title">Centered</h3>
      <p class="card-description">Inset media, centered content.</p>
    </div>
    <div class="card-footer"><button class="btn" data-size="sm">Buy now</button></div>
  </article>
</div>
```

```html example label="Image on the side" hint="data-layout=&quot;side&quot;: media | body in one row. Put the figure after the .card-body for the image on the right."
<div class="stack gap-4" style="max-width: 36rem">
  <article class="card" data-layout="side">
    <figure class="card-media"
      ><img src="images/photos/x-1470071459604-3b5ec3a7fe05-600x400.webp" alt="Sunlit forest"
    /></figure>
    <div class="card-body">
      <div class="card-header">
        <h3 class="card-title">New album is released</h3>
        <p class="card-description">Click the button to listen on the app.</p>
      </div>
      <div class="card-footer"><button class="btn" data-size="sm">Listen</button></div>
    </div>
  </article>
  <article class="card" data-layout="side">
    <div class="card-body">
      <div class="card-header">
        <h3 class="card-title">Image on the right</h3>
        <p class="card-description">The figure comes after the body.</p>
      </div>
      <div class="card-footer"><button class="btn" data-variant="outline" data-size="sm">Details</button></div>
    </div>
    <figure class="card-media"
      ><img src="images/photos/x-1518837695005-2083093ee35b-600x400.webp" alt="Waves on a beach"
    /></figure>
  </article>
</div>
```

```html example label="Responsive by its own width" hint="data-layout=&quot;auto&quot;: side by side while the CARD is wide enough, stacked when it is not. The switch follows the card's own width, not the screen - the same card, in a narrow and a wide column."
<div class="grid gap-4" style="grid-template-columns: minmax(0, 16rem) minmax(0, 1fr)">
  <article class="card" data-layout="auto">
    <figure class="card-media"
      ><img src="images/photos/x-1501785888041-af3ef285b470-600x400.webp" alt="A green valley"
    /></figure>
    <div class="card-body">
      <div class="card-header">
        <h3 class="card-title">Weekend trip</h3>
        <p class="card-description">Two nights in the valley, trails and a lake.</p>
      </div>
      <div class="card-footer"><button class="btn" data-size="sm">Book</button></div>
    </div>
  </article>
  <article class="card" data-layout="auto">
    <figure class="card-media"
      ><img src="images/photos/x-1501785888041-af3ef285b470-600x400.webp" alt="A green valley"
    /></figure>
    <div class="card-body">
      <div class="card-header">
        <h3 class="card-title">Weekend trip</h3>
        <p class="card-description">Two nights in the valley, trails and a lake.</p>
      </div>
      <div class="card-footer"><button class="btn" data-size="sm">Book</button></div>
    </div>
  </article>
</div>
```

```html example label="Badges and indicators" hint="A badge in the title, tag badges in the footer, and an .indicator pinning a &quot;New&quot; badge to the card's corner."
<div class="indicator" style="width: 20rem; max-width: 100%">
  <span class="indicator-item badge" data-variant="default">New</span>
  <article class="card">
    <figure class="card-media"
      ><img src="images/photos/x-1588345921523-c2dcdb7f1dcd-600x400.webp" alt="Abstract shapes"
    /></figure>
    <div class="card-header">
      <h3 class="card-title flex items-center gap-2"
        >Design system <span class="badge" data-variant="secondary">v2</span></h3
      >
      <p class="card-description">Tokens, components and a verifier that never sleeps.</p>
    </div>
    <div class="card-footer" style="justify-content: flex-end">
      <span class="badge" data-variant="outline">CSS</span>
      <span class="badge" data-variant="outline">Tokens</span>
    </div>
  </article>
</div>
```

```html example label="Pricing with an aura" hint="A pricing card: badge, price, a feature list with what is included and what is not, and a full-width button. The aura-rainbow wrapper from Shapes singles out the plan to pick."
<div class="flex flex-wrap items-start justify-center gap-6 p-4">
  <div class="card" style="width: 17rem">
    <div class="card-header">
      <h3 class="card-title">Starter</h3>
      <p class="card-description"
        ><span style="font-size: 1.75rem; font-weight: 700; color: var(--card-foreground)">€0</span> / month</p
      >
    </div>
    <div class="card-content" style="padding-top: 1rem">
      <ul class="stack gap-2 m-0 p-0 text-sm" style="list-style: none">
        <li class="flex items-center gap-2"><i data-lucide="check"></i> 3 projects</li>
        <li class="flex items-center gap-2"><i data-lucide="check"></i> Community support</li>
        <li class="flex items-center gap-2 text-muted-foreground" style="text-decoration: line-through"
          ><i data-lucide="x"></i> Custom domains</li
        >
        <li class="flex items-center gap-2 text-muted-foreground" style="text-decoration: line-through"
          ><i data-lucide="x"></i> Priority support</li
        >
      </ul>
    </div>
    <div class="card-footer"><button class="btn w-full" data-variant="outline">Start free</button></div>
  </div>
  <div class="aura aura-rainbow aura-lg" style="width: 17rem">
    <div class="card">
      <div class="card-header">
        <span class="badge" data-variant="default" style="width: fit-content">Most popular</span>
        <h3 class="card-title">Pro</h3>
        <p class="card-description"
          ><span style="font-size: 1.75rem; font-weight: 700; color: var(--card-foreground)">€19</span> / month</p
        >
      </div>
      <div class="card-content" style="padding-top: 1rem">
        <ul class="stack gap-2 m-0 p-0 text-sm" style="list-style: none">
          <li class="flex items-center gap-2"><i data-lucide="check"></i> Unlimited projects</li>
          <li class="flex items-center gap-2"><i data-lucide="check"></i> Priority support</li>
          <li class="flex items-center gap-2"><i data-lucide="check"></i> Custom domains</li>
          <li class="flex items-center gap-2"><i data-lucide="check"></i> Team roles</li>
        </ul>
      </div>
      <div class="card-footer"><button class="btn w-full">Upgrade to Pro</button></div>
    </div>
  </div>
</div>
```

```html example label="Selectable cards" hint="A label.card around a radio or checkbox: the whole card is the hit area, the checked one takes a primary ring, keyboard focus shows a focus ring - no JavaScript. The native input stays in charge of the value and the form."
<div class="stack gap-4" style="max-width: 36rem">
  <fieldset class="grid grid-cols-auto gap-3 m-0 p-0" style="border: 0; --layout-min: 10rem">
    <legend class="text-sm font-medium mb-2">Plan</legend>
    <label class="card" data-size="sm">
      <div class="card-header">
        <span class="flex items-center justify-between"
          ><span class="card-title">Hobby</span><input type="radio" class="radio" name="card-plan" value="hobby"
        /></span>
        <p class="card-description">€0 / month</p>
      </div>
    </label>
    <label class="card" data-size="sm">
      <div class="card-header">
        <span class="flex items-center justify-between"
          ><span class="card-title">Pro</span><input type="radio" class="radio" name="card-plan" value="pro" checked
        /></span>
        <p class="card-description">€19 / month</p>
      </div>
    </label>
    <label class="card" data-size="sm">
      <div class="card-header">
        <span class="flex items-center justify-between"
          ><span class="card-title">Team</span><input type="radio" class="radio" name="card-plan" value="team"
        /></span>
        <p class="card-description">€49 / month</p>
      </div>
    </label>
  </fieldset>
  <fieldset class="grid grid-cols-auto gap-3 m-0 p-0" style="border: 0; --layout-min: 10rem">
    <legend class="text-sm font-medium mb-2">Add-ons</legend>
    <label class="card" data-size="sm">
      <div class="card-header">
        <span class="flex items-center justify-between"
          ><span class="card-title">Backups</span
          ><input type="checkbox" class="checkbox" name="card-addon" value="backups" checked
        /></span>
        <p class="card-description">Daily, 30 days</p>
      </div>
    </label>
    <label class="card" data-size="sm">
      <div class="card-header">
        <span class="flex items-center justify-between"
          ><span class="card-title">Analytics</span
          ><input type="checkbox" class="checkbox" name="card-addon" value="analytics"
        /></span>
        <p class="card-description">Privacy-first</p>
      </div>
    </label>
    <label class="card" data-size="sm">
      <div class="card-header">
        <span class="flex items-center justify-between"
          ><span class="card-title">SSO</span
          ><input type="checkbox" class="checkbox" name="card-addon" value="sso" disabled
        /></span>
        <p class="card-description">Enterprise login</p>
      </div>
    </label>
  </fieldset>
</div>
```

```html example label="Link cards" hint="Put the card classes on an &lt;a&gt; (or add data-interactive): it lifts on hover and shows a focus ring on keyboard focus - under reduced motion it stays put."
<div class="grid grid-cols-auto gap-4" style="--layout-min: 14rem">
  <a class="card" href="#card-link-1">
    <div class="card-header">
      <h3 class="card-title">Getting started →</h3>
      <p class="card-description">Install and render your first component.</p>
    </div>
  </a>
  <a class="card" href="#card-link-2" data-layout="side">
    <figure class="card-media"><img src="images/photos/x-1469474968028-56623f02e42e-300x300.webp" alt="" /></figure>
    <div class="card-body"
      ><div class="card-header">
        <h3 class="card-title">Guides →</h3>
        <p class="card-description">Theming, layout, shapes.</p>
      </div></div
    >
  </a>
</div>
```

```html example label="Colors" hint="Primary and neutral (charcoal) surfaces for a call to action, and any color of your own through the tokens a card reads (--card, --card-foreground, --border). Ghost and link buttons on a colored card follow its text color; use secondary or outline buttons for the main action."
<div class="grid grid-cols-auto gap-4" style="--layout-min: 15rem">
  <div class="card" data-variant="primary">
    <div class="card-header">
      <h3 class="card-title">Primary</h3>
      <p class="card-description">Ship the release notes today.</p>
    </div>
    <div class="card-footer"><button class="btn" data-variant="secondary" data-size="sm">Publish</button></div>
  </div>
  <div class="card" data-variant="neutral" data-align="center">
    <div class="card-header">
      <h3 class="card-title">Cookies</h3>
      <p class="card-description">We use cookies to keep you signed in.</p>
    </div>
    <div class="card-footer"
      ><button class="btn" data-variant="secondary" data-size="sm">Accept</button
      ><button class="btn" data-variant="ghost" data-size="sm">Deny</button></div
    >
  </div>
  <div
    class="card"
    style="
      --card: oklch(0.93 0.06 160);
      --card-foreground: oklch(0.3 0.08 160);
      --border: oklch(0.8 0.08 160);
      --muted-foreground: oklch(0.42 0.07 160);
    "
  >
    <div class="card-header">
      <h3 class="card-title">Your own colors</h3>
      <p class="card-description">Three tokens, set on the card.</p>
    </div>
    <div class="card-footer"><button class="btn" data-variant="outline" data-size="sm">Nice</button></div>
  </div>
</div>
```

```html example label="Shapes, frames and stacks" hint="Every shape utility from Shapes composes with a card: cut and scooped corners, an organic leaf corner, tape and a polaroid frame, an app window, a hard offset shadow, and a stack of sheets behind it."
<div class="grid grid-cols-auto items-start gap-10 p-6" style="--layout-min: 13rem">
  <div class="card cut-corners">
    <div class="card-header">
      <h3 class="card-title">Cut corners</h3>
      <p class="card-description">cut-corners</p>
    </div>
  </div>
  <div class="card scoop-corners">
    <div class="card-header">
      <h3 class="card-title">Scooped</h3>
      <p class="card-description">scoop-corners</p>
    </div>
  </div>
  <div class="card corner-leaf">
    <div class="card-header">
      <h3 class="card-title">Leaf</h3>
      <p class="card-description">corner-leaf</p>
    </div>
  </div>
  <div class="card frame-tape">
    <div class="card-header">
      <h3 class="card-title">Taped</h3>
      <p class="card-description">frame-tape</p>
    </div>
  </div>
  <div class="card frame-window">
    <div class="card-header">
      <h3 class="card-title">Window</h3>
      <p class="card-description">frame-window</p>
    </div>
  </div>
  <div class="card shadow-hard">
    <div class="card-header">
      <h3 class="card-title">Hard shadow</h3>
      <p class="card-description">shadow-hard</p>
    </div>
  </div>
  <div class="card stack-bottom">
    <div class="card-header">
      <h3 class="card-title">A pile</h3>
      <p class="card-description">stack-bottom</p>
    </div>
  </div>
  <div class="card stack-bottom-right stack-outline">
    <div class="card-header">
      <h3 class="card-title">Outlined sheets</h3>
      <p class="card-description">stack-bottom-right stack-outline</p>
    </div>
  </div>
  <figure class="card frame-polaroid m-0" style="max-width: 13rem">
    <img
      src="images/photos/x-1518837695005-2083093ee35b-400x400.webp"
      alt="Waves"
      style="display: block; width: 100%; aspect-ratio: 1; object-fit: cover"
    />
    <figcaption class="text-sm" style="padding: 0.75rem 0 0; text-align: center">frame-polaroid</figcaption>
  </figure>
</div>
```

```html example label="With an aura" hint="Any aura from Shapes wraps a card: the default light, a glow halo, gold."
<div class="grid grid-cols-auto gap-8 p-6" style="--layout-min: 14rem">
  <div class="aura">
    <div class="card"
      ><div class="card-header">
        <h3 class="card-title">aura</h3>
        <p class="card-description">A light runs around it.</p>
      </div></div
    >
  </div>
  <div class="aura aura-glow aura-rainbow">
    <div class="card"
      ><div class="card-header">
        <h3 class="card-title">aura-glow</h3>
        <p class="card-description">A turning halo behind it.</p>
      </div></div
    >
  </div>
  <div class="aura aura-gold aura-lg">
    <div class="card" data-variant="neutral"
      ><div class="card-header">
        <h3 class="card-title">aura-gold</h3>
        <p class="card-description">On a neutral card.</p>
      </div></div
    >
  </div>
</div>
```

```html example label="Density" hint="Set data-density on the component root to scale its internal whitespace. A whitespace policy, not a zoom: only gaps and padding scale (ratio 0.75 / 1 / 1.25), typography and fixed dimensions stay identical. comfortable matches the unsized default."
<div class="flex flex-wrap gap-4">
  <div class="flex-1 min-w-48">
    <p class="demo-label">Compact</p>
    <div class="card" data-density="compact"
      ><div class="card-header"
        ><h3 class="card-title">Density</h3><p class="card-description">Section padding scales.</p></div
      ><div class="card-content"><p>Body copy stays put - only whitespace changes.</p></div
      ><div class="card-footer"><span>Footer</span></div></div
    >
  </div>
  <div class="flex-1 min-w-48">
    <p class="demo-label">Comfortable</p>
    <div class="card" data-density="comfortable"
      ><div class="card-header"
        ><h3 class="card-title">Density</h3><p class="card-description">Section padding scales.</p></div
      ><div class="card-content"><p>Body copy stays put - only whitespace changes.</p></div
      ><div class="card-footer"><span>Footer</span></div></div
    >
  </div>
  <div class="flex-1 min-w-48">
    <p class="demo-label">Spacious</p>
    <div class="card" data-density="spacious"
      ><div class="card-header"
        ><h3 class="card-title">Density</h3><p class="card-description">Section padding scales.</p></div
      ><div class="card-content"><p>Body copy stays put - only whitespace changes.</p></div
      ><div class="card-footer"><span>Footer</span></div></div
    >
  </div>
</div>
```

<SourceFiles component="card" section="css" />

</DocPage>
