onOpenChange–
(id: string | null) => voidThe user opened a card's drill-in or closed it (×, Escape, the card again).
formatValue–
(value: number, metric: GlassStatMetric) => stringFormats every metric without its own format (the value, absolute changes, goal and drill-in values).
currency"USD" ($)
stringISO code for unit "currency"; its narrow symbol replaces $ ("EUR" → €2.41M).
locale"en-US"
stringGrouping in counts and the currency symbol's locale. Compact forms (2.41M) keep the design's notation; pass formatValue for fully localised numbers.
formatDate"09:00" / "Sep 4"
(date: Date, style: "time" | "day") => stringDates in the notes: No data since …, Tracking since ….
labelsdefaultGlassStatCardsLabels
Partial<GlassStatCardsLabels>Every string for i18n: verdicts, change line (vsPrev, points), headline sentences, freshness notes, goal notes, the hero sentence (heroSentence gets { tone, up, unit, amount, prior }), aria text and the drill-in. The defaults are the design's wording.
nowthe browser clock after mount
Date | number | stringClock for "Updated 2 min ago" and staleness. Pass it for deterministic renders; the designed data brings its own.
motion"full"
"full" | "subtle" | "off"full: the designed motion. subtle: 30% shorter, calm curve, no staggers. off: instant. prefers-reduced-motion: 150ms fades, no rolling digits.
layout"auto"
"auto" | "desktop" | "mobile"auto goes 2×2 and stacks the hero in narrow containers; desktop / mobile force one.
theme"system"
"system" | "dark" | "light"system follows a .dark / .light class or data-theme on an ancestor (next-themes, shadcn), else the OS.
soundtrue
boolean | "subtle"Built-in sound: true plays Lumen cues when a GlassSoundProvider (glass-sound) enables sound; false silences this instance (its cues and its clicks); "subtle" plays at 55%. Without a provider it is silent.
className / style–
string / CSSPropertiesOn the root. The section is width 100% up to max-width var(--glass-max-width, 1120px): override with the variable, style or a max-w-* class.
ref–
Ref<HTMLDivElement>The root element (React 19 ref prop).
...rest–
HTML attributesid, data-*, aria-* and event handlers go to the root; aria-label names the section instead of the eyebrow; onKeyDown runs before the built-in Escape (preventDefault skips it).
CSS variables–
--glass-accent, --glass-good, --glass-bad, --glass-warn (+ -text, -dark / -light), --glass-max-widthSet on the cards or any ancestor to recolour the accent (goal bar, selection, focus), good / bad tones (fills, glows; -text for the change text) and stale amber. --glass-max-width caps the section width.
GlassStatCard–
{ label, value, previous?, unit?, format?, suffix?, locale?, currency?, formatDate?, labels?, goodDirection?, periodLabel?, periodName?, trend?, goal?, updatedAt?, trackingSince?, staleAfterMs?, now?, size?, selected?, onOpen?, controls?, motion?, layout?, theme?, className?, style?, ref? }One card on its own, with the same format and label overrides. onOpen makes it a button (selected drives the ring and aria-expanded). HTML attributes go to its root.