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.

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 pathPurpose
card.bgBackground color.
card.fgForeground color.
card.borderOuter border color.
card.header-borderDivider between parts.
card.radiusBorder radius.
card.paddingPadding 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.