Stat Card

Card for a key metric and how it changed.

Recurring revenue
12.4%
$48,210
vs. last month
Churn rate
0.4 pts
2.4%
Trailing 90 days

Installation

pnpm dlx shadcn@latest add @paneui/stat-card

Usage

Composition

Examples

With Number Ticker

Use for live numbers that change while the page is open.

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.

API Reference

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, negative or neutral, from the delta.
Data attributeDescription
data-tonepositive, 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.
PropTypeDefaultDescription
value*number—The change; its sign sets the arrow.
unitstring"%"Suffix after the number.
invertbooleanfalseA rise is bad.
precisionnumber1Decimal places.

StatCardSparkline

A 96 × 36 sparkline tinted by the card's tone. Also accepts every prop of Sparkline.

StatCardLabel, StatCardValue, StatCardHint, StatCardHeader, StatCardFooter

Layout parts. The value is text-2xl semibold with tabular numbers. Also accepts every prop of div.