Spectra v0.1

Components / cards

Priority 1

Cards

Back to docs

Cards are one of Spectra’s core surface components. Keep them token-driven: surface color, border, radius, and shadow come from the system.

Card API

ClassUsed forNotes
.sp-cardBase surface cardUses --sp-surface, --sp-border-1, --sp-radius-3, and --sp-shadow-1.
.sp-card--elevRaised cardMoves to --sp-elev and --sp-shadow-2.
.sp-card--compactTighter densityReduces header/body/footer padding from --sp-4 to --sp-3.
.sp-card__headerOptional top sectionGets the standard padding and a bottom border.
.sp-card__bodyMain content regionDefault place for prose, UI, or docs content.
.sp-card__footerOptional footer sectionGets a top border and subtle text treatment.

Preview

Base card

Default surface, border, radius, and shadow.

Elevated card

Use for hero surfaces, callouts, or more raised groups.

Compact

Same structure, smaller padding.

Typical markup

<article class="sp-card sp-card--elev">
  <div class="sp-card__body sp-stack">
    <h2 class="sp-h4">Card title</h2>
    <p class="sp-muted">Token-driven surface styling.</p>
  </div>
</article>