Skip to content

Card

Cards are implemented using the .card class. This class can be applied to any semantic element like <article>, <div>, or <section>.

Basic Usage

live preview
editable html
<div class="card">
  <hgroup>
    <h2>Card title</h2>
    <p>This is the subtitle</p>
  </hgroup>
  <p>This is the main content of the card.</p>
</div>

Cards support <header> and <footer> child elements with distinct background styling.

live preview
editable html
<div class="card">
  <header>
    <h2>Card title</h2>
  </header>
  <p>Cards support optional header and footer sections that are visually distinct from the main content.</p>
  <footer>
    <button class="secondary">Cancel</button>
    <button>Confirm</button>
  </footer>
</div>

Variants

Intent Variants

To convey intent and importance, cards can be styled with different variants:

live preview
See code

Modifiers

.subtle creates cards with a more muted appearance, often used for less prominent actions.

live preview
See code

.ghost creates transparent background cards with colored text and borders, useful for secondary actions where you want minimal visual weight.

live preview
See code