Hero Metric
A bordered hero card for showcasing a single live KPI with tone-aware styling.
Feed-in right now
1,240 WUsage
import {
HeroMetric,
HeroMetricLabel,
HeroMetricValue,
HeroMetricValueUnit,
} from '@epilot/spark-ui/hero-metric'<HeroMetric>
<HeroMetricLabel>Feed-in right now</HeroMetricLabel>
<HeroMetricValue tone="success">
1,240 <HeroMetricValueUnit>W</HeroMetricValueUnit>
</HeroMetricValue>
</HeroMetric>HeroMetric is a layout primitive: a centered, bordered card. The label, value, and unit slots are simple wrappers that apply the right typography and (for the value) tone color.
Examples
All tones
The tone prop on HeroMetricValue colors the number to convey state.
success
1,240 Wwarning
1,240 Werror
1,240 Waccent
1,240 Wneutral
1,240 WAPI Reference
HeroMetricValue
| Prop | Type | Default |
|---|---|---|
tone | "success" | "warning" | "error" | "accent" | "neutral" | "neutral" |
HeroMetricValueUnit
A smaller, semibold unit suffix to render inline with the value (e.g. W, kW).
Accessibility
HeroMetricis a non-interactive layout shell — plaindiv/spanwrappers with no role or keyboard behavior.- Don't put meaning in
tonealone. Pair the colored value with wording in the label (or elsewhere) that states the condition. - Keep the label text present so the metric has a visible name; don't rely on color or position alone.