Skip to content

Card

hc-card is a thin container with a border, a subtle radius, and optional header/body/footer parts. It is a layout primitive — not something that owns interaction or state.

Also known as: panel, tile.

Order #123

Two items, shipping on Friday.

Parts are optional. A card with only .hc-card__body is fine, and so is a card with no parts at all — direct children get the same padding as the body so plain content still looks right.

<article class="hc-card">
<div class="hc-card__body">
<h3>Heads up</h3>
<p>A card without an explicit header still works.</p>
</div>
</article>

For card grids, pair hc-card with the layout primitive of your choice (CSS grid, the hc-stack utility, or any flex container). The card itself does not impose horizontal spacing.

  • Use the most accurate landmark element for the card root:
    • <article> for a self-contained piece of content;
    • <section> for a thematic grouping within a page;
    • <div> when no landmark semantics apply.
  • A card’s heading should match the page’s heading hierarchy. Do not skip levels just because the card is small.
Token path Purpose
card.bg Background color.
card.fg Foreground color.
card.border Outer border color.
card.header-border Divider between parts.
card.radius Border radius.
card.padding Padding for each card part.
Show the generated CSS variables
--hc-card-bg | -fg | -border | -header-border
--hc-card-radius
--hc-card-padding
  • Table — for tabular data inside or outside a card.
  • Alert — for prominent messages.

Used in recipes: Lazy panel