Skip to content

Sparkline

A word-sized trend with no axes. Signups below are honest sample data, rendered as a static SVG.

Signups trend

Sparkline, ends at 42, high 42Static sparkline of Sparkline. Values read left to right.
<Sparkline data={signups} />

Sized

Pass width, height, and strokeWidth to fit the line to its slot.

Weekly commits, ends at 15, high 15Static sparkline of Weekly commits. Values read left to right.
<Sparkline label="Weekly commits" data={weekly} width={160} height={40} strokeWidth={2} />

Props

PropTypeDefaultDescription
datanumber[]-Points in order, left to right.
widthnumber120viewBox width; the SVG scales to 100%.
heightnumber32viewBox height.
labelstring"Sparkline"Chart name; opens the auto-summary.
strokeWidthnumber1.5Line weight.
classstring-Style passthrough.

Static honesty

Static SVG polyline, no axes, dots, or hover states. Fewer than two points draws a flat mid line and the label notes the point count.

Accessibility