Stat

data-display

KPI stat card with label, large value, trend direction indicator, and optional icon. Token-driven colors and typography.

Import

typescript
import { Stat } from "packages/ui/src";

Props

StatProps

PropTypeRequired
labelstringYes
valuestring | numberYes
trendStatTrendNo
trendTextstringNo
iconReactNodeNo

Examples

Stat Cards

KPI stat cards with trend indicators for dashboards and metrics displays.

Dashboard Stats

Components
60+5 this session
Tokens
911+64 this session
Tests
435+40 this session
Drift Score
100/100Maintained

Trend Directions

Revenue
$42K+12% from last month
Bounce Rate
32%-5% from last week
Uptime
99.9%Stable

Minimal (No Trend)

Active Users
1,247
Projects
5
Routes
62

Metadata

Component Metadata
Familydata-display
FrameworksNext.js, Astro/EmDash
DescriptionKPI stat card with label, large value, trend direction indicator, and optional icon. Token-driven colors and typography.
PropsStatProps (label: string, value: string | number, trend?: StatTrend, trendText?: string, icon?: ReactNode)
Statesup-trend, down-trend, neutral-trend, no-trend, with-icon
A11y
  • Container has role=group with aria-label
  • Icon is aria-hidden
  • Trend arrows are aria-hidden
Responsive
  • Flex column layout
  • Stacks naturally in grid
Motion
  • No motion by default
Token Dependencies
  • components.stat.bg
  • components.stat.borderColor
  • components.stat.borderRadius
  • components.stat.padding
  • components.stat.labelColor
  • components.stat.labelFontSize
  • components.stat.valueColor
  • components.stat.valueFontSize
  • components.stat.trendUpColor
  • components.stat.trendDownColor
  • components.stat.trendFontSize
  • components.stat.trendIconSize
Content Slotslabel (string), value (string|number), trendText (string), icon (ReactNode)
CMS Bindings
  • Value from CMS metric field
  • Trend from CMS calculated field
Test Cases
  • Renders label
  • Renders value
  • Has role=group
  • Up trend has up class
  • Down trend has down class
  • Shows trend text
  • Renders icon when provided
  • Passes className through