Metric Card
Pair a key value with its label and supporting context.
Preview
Import
import { MetricCard } from "@sigil-ui/components";Usage
<div className="grid w-full grid-cols-1 gap-[var(--s-space-16)] sm:grid-cols-2">
<MetricCard
label="Total Revenue"
value="$24.5K"
delta="+12.3%"
deltaLabel="vs last month"
sparkData={[18, 22, 19, 25, 28, 24, 30, 35, 32, 38]}
/>
<MetricCard
label="Active Users"
value="1,284"
delta="-3.1%"
deltaLabel="vs last week"
sparkData={[40, 38, 42, 35, 30, 33, 28, 25, 22, 20]}
sparkColor="var(--s-error, #ef4444)"
/>
</div>Props
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | — | — |
value | string | number | — | — |
delta | string | — | — |
deltaLabel | string | — | — |
icon | ReactNode | — | — |
sparkData | number[] | — | Mini sparkline data. |
sparkColor | string | — | Spark color. |
Token integration
| CSS Variable | Purpose |
|---|---|
--s-radius-card | Radius card |
--s-border-style | Border style |
--s-border | Border |
--s-surface | Surface |
--s-shadow-sm | Shadow sm |
--s-text-muted | Text muted |
--s-text | Text |
--s-font-mono | Font mono |
--s-success | Success |
--s-error | Error |
--s-primary | Primary |