Stat

Displays a key metric with optional delta, trend direction and help text

Category: display · WCAG 2.2-AA · stat, kpi, metric, number

Props

PropTypeDefaultDescription
cardbooleanfalseWrap the tile in the same card chrome `@cascivo/charts`' `Kpi` ships (surface, border, radius, padding), so a `Stat` row and a `Kpi` row in one dashboard read as one system. Off by default: `Stat` is layout-only so it can sit inside a `Card` you control.
labelstringWhat the metric measures
valuestring | numberThe metric value
deltastringChange indicator rendered next to the trend arrow
trend'up' | 'down' | 'flat'flatDirection of the trend indicator ('up' | 'down' | 'flat').
helpTextstringFine print below the value (methodology, time range)
visualReact.ReactNodeTrailing decorative visual, e.g. a Sparkline from the separate @cascivo/charts package (not exported from @cascivo/react), rendered below the value/delta/helpText

Design tokens

When to use

When not to use

How to build an accessible Stat in React →

Examples

Default

<Stat label="Components" value={106} />

With trend

<Stat label="Bundle size" value="12.4 kB" delta="-1.2 kB" trend="up" />

With help text

<Stat label="Axe violations" value={0} helpText="WCAG 2.1 AA, 4 app states" />

With a trailing sparkline

Sparkline is from @cascivo/charts

<Stat label="Requests / min" value="1.2k" delta="+4.3%" trend="up" visual={<Sparkline data={requestsPerMinute} label="Requests per minute trend" />} />

Related components

← Back to docs