Stat Card
Card for a key metric and how it changed.
Installation
pnpm dlx shadcn@latest add @paneui/stat-cardUsage
Composition
Examples
Tone
StatCardDelta takes its tone from the sign, success for a rise, destructive for a fall and neutral at zero. Pass invert for metrics where up is bad (churn, latency, errors). StatCardSparkline follows the same tone unless you give it a text colour.
StatCard
Raised card (rounded-xl, shadow-raised, 16px padding) that shares the delta's tone with the sparkline. Also accepts every prop of div.
- data-tone
positive,negativeorneutral, from the delta.
| Data attribute | Description |
|---|---|
| data-tone | positive, negative or neutral, from the delta. |
StatCardDelta
Also accepts every prop of Badge.
- value*
- number
- The change; its sign sets the arrow.
- unit= "%"
- string
- Suffix after the number.
- invert= false
- boolean
- A rise is bad.
- precision= 1
- number
- Decimal places.
| Prop | Type | Default | Description |
|---|---|---|---|
| value* | number | — | The change; its sign sets the arrow. |
| unit | string | "%" | Suffix after the number. |
| invert | boolean | false | A rise is bad. |
| precision | number | 1 | Decimal places. |