Stat
Shows a labeled metric with supporting details.
24
Up 3 from last month
stat-demo.tsx
Installation
The CLI adds the files, packages, theme variables, and Tailwind plugin that this component uses. Before you run it, set up your project.
npm
yarn
pnpm
bun
Composition
StatGroupOptionalStatRepeatsStatIconOptionalStatLabelStatValueStatDetailOptionalStatTrendOptional
Trend
Include a plus or minus sign so the direction does not depend on color. Set invert when a lower value is better.
$48,200
+12%From last month
9,630
−3%From last month
1.8%
−0.4 ptFrom last month
stat-trend-demo.tsx
Group
StatGroup joins stats in one surface. The columns wrap on narrow screens.
$48.2k
+12%
1,284
+8%
9,630
0%
1.4 h
−22 min
stat-group-demo.tsx
Live value
Also install Animated number.
1,284
Updates every few seconds
stat-live-demo.tsx
API reference
StatTrend
- direction: "up" | "down" | "neutral"Required
- Sets the arrow.
- invert: boolean = false
- Shows a fall as good and a rise as bad. Use it for values such as churn or response time.