Skip to main content

StatCard

Compares related metrics side by side (target vs actual, etc.).

Signature
Density
Viewport
Theme and light/dark are set in the top bar
Live demo
Open ↗

When to use​

Compares related metrics side by side (target vs actual, etc.).

Accessibility​

When the whole card is actionable, expose a single accessible name and make it reachable with Tab + Enter. Decorative imagery uses empty alt.

Install and import​

npx shadcn@latest add @prism/stat-card
import { StatCard } from '@/components/prism/StatCard';

In a no-build prototype, read it from the bundle instead: const { StatCard } = window.PrismDesignSystem_39d121;

Props​

PropTypeRequiredDescription
titleReact.ReactNode—
iconReact.ReactNode—
statsStatItem[]YesRelated metrics shown side by side with dividers. All are shown; they wrap onto more rows when the card is narrow (about 72px per stat).
valueFont"display" | "mono" | "body"—The figures' face: "display" (default), "mono" or "body". Theme-wide: set --figure-font.
classNamestring—