Sparkline · BarMini Widget

Shape of a series, sized to sit inside a Statistic. No axis, no scale, no tooltip — the moment you need those, reach for a charting library.

Usage

Revenue

35.2M

+9.4%

Signups

18

+3
tsx
<Sparkline values={revenue} filled hue="teal" label="Revenue trend" /><BarMini values={signups} hue="violet" label="Signups per day" />
<Statistic label="Revenue" value="35.2M" visual={<Sparkline values={revenue} filled />} />

The cases that break naive versions

  • A flat series sits on the middle line, not on the floor. Dividing by a zero range is how a steady metric renders as a crash.
  • A single point is centred rather than pinned to the left edge.
  • A zero-height bar keeps a one-pixel foot, so "none" is visible as a bar rather than absent.
  • Non-finite values are filtered out before anything is measured.

Do

Give it a label that names the series — 'Revenue trend', not 'Chart'.

Don't

Ask people to read values off it. It shows direction; the number belongs next to it.

Props

PropTypeDefaultNotes
valuesnumber[]In order. Non-finite entries are ignored.
width / heightnumber120 / 32The drawing box, in px.
tone / hueTone | DecorHuetone='brand'Line and fill colour.
filledbooleanfalseSparkline only: fills under the line.
showLastbooleantrueSparkline only: dot on the final point.
labelstringRequired accessible name.