Skip to main content

Sparkline

Interactive

See Sparkline in Storybook for every variant, with live controls.

An inline trend line. Pure SVG, purely presentational.

import { Sparkline } from "@kairosis/eidos";

<Sparkline data={[12, 18, 14, 22, 19, 27, 31]} />;

Props

PropTypeDefaultDescription
datanumber[]Required. Renders nothing when empty
widthnumber120px
heightnumber32px
colorstringvar(--primary)
fillbooleantrueTint the area under the line
strokeWidthnumber1.5

Guidelines

  • It has no axes, labels or tooltips — it shows shape, not values. Pair it with a Stat when the number matters.
  • Scales to its own min/max, so it shows relative movement. Two sparklines side by side are not comparable unless you normalise the data yourself.
  • A flat series draws down the middle rather than collapsing to the baseline.
  • The last point is marked with a dot — the current value is usually the one being read.
  • aria-hidden, because the data belongs in text next to it.