MetricCard
Value + unit + delta + embedded sparkline trend.
Basic usage
Data is passed via props; pure SVG rendering with no third-party chart library.
Colors come from the --viz-1..8 tokens and are color-blind friendly.
12,420
3,180
6.2%
Demo source
<CfMetricCard ... /> <CfMetricCard ... /> Grid layout
Pair with grid-template-columns: repeat(auto-fit, minmax(...)) for adaptive density.
12,420
3,180
6.2%
3:42
0.18%
Demo source
<CfMetricCard label="…" value="…" :delta="…" :trend="[…]" /> <CfMetricCard label="…" value="…" delta={…} trend={[…]} /> API
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | — | Small top label |
value | string | number | — | Main value |
unit | string | — | Unit (after the value) |
delta | number | — | Percentage change; tinted by sign |
trend | number[] | — | Embedded sparkline data |
反馈与讨论
MetricCard · Discussion