docs / patterns / stat-card
StatCard
one metric in a tile: a big value, a quiet unit, and a colored trend. one featured tile per grid; the rest stay smaller.
intensity · structuresrsc · server
provenance
shaped from personal-websitelayer
core / patternsintensity
structures · organizes a region, stays out of the contentcomposition
grids of two to four on a dashboard, or inside DashboardGridthe spark slot takes a sparkline that stretches to the tile widthnot a marketing proof strip, that is StatBentono actions inside. a metric that opens something wraps in a linka11y
the icon and trend glyph arearia-hidden · the trend meaning is duplicated by the note text, never color alonejest-axedependencies
Card from the same packagelive demo · try it out
Revenue
48.2k
8.1% MoM
Response time
128ms
12% faster
Active users
2,940
steady
Error rate
0.03%
within SLO
featured · tone
Stars
12.4k
all-time
Uptime
99.98%
30-day
props
| prop | type | default | notes |
|---|---|---|---|
| label | React.ReactNode | — | the uppercase metric label at the top. |
| value | React.ReactNode | — | the figure. mono, tabular, the loudest thing in the tile. |
| unit | React.ReactNode | — | quiet suffix beside the value, e.g. ms, %. |
| note | React.ReactNode | — | the footnote beside the trend glyph. |
| icon | React.ReactNode | — | decorative glyph chip in the top-right corner. |
| trend | "up" | "down" | "flat" | — | colors the note and prepends a directional glyph. up is success, down is danger. |
| size | "sm" | "md" | "md" | padding and value size. |
| featured | boolean | false | blows the tile up to a hero stat with a much larger numeral. |
| tone | "neutral" | "accent" | "accent-alt" | "neutral" | tints the border and colors the value. |
| surface | CardSurface | "elevated" | how the tile sits on the page. passed through to Card. |
| spark | React.ReactNode | — | slot for a sparkline or mini-chart, stretched to fill. |
get it
bun add @usva-ui/reactusage
import { StatCard } from "@usva-ui/react/patterns/stat-card";
<StatCard
label="Response time"
value="128"
unit="ms"
trend="down"
note="12% faster"
/>