Sparkline
↗ Try the live demoimport { Sparkline } from '@wick-charts/react'; <Sparkline data={data} />A self-contained miniature chart for tables, KPIs, and dashboards. Renders without any of the chrome (<YAxis>, <TimeAxis>, etc.) and includes a lightweight value badge.
Props
Data points plotted by the sparkline. A flat TimePointInput[] (time may be ms or a Date) — the sparkline only ever shows one tiny line/bar.
Unix milliseconds, or a Date (converted via getTime() internally).
Y-axis value at this point. Drives the line height / bar height. null is a gap: the line breaks there and the tooltip leaves the point out.
{
capacity: number;
align?: 'left' | 'right' | 'offscreen'
}Streaming-window mode: viewport is fixed at capacity bars wide. Pass at least two seed points in data so the initial window can infer the tick interval.
align controls where the seed sits at mount:
- 'right' *(default)* — seed flush with the right edge; each tick
shifts the viewport left by one interval and the new tick lands at the right edge.
- 'left' — seed flush with the left edge; the viewport is held in
place until empty bars on the right are consumed, then normal tail-scroll resumes.
- 'offscreen' — seed starts one interval past the right edge so the
first tick's tail-scroll animates it onto canvas (a brief "drive-in" effect).
Visual theme. Drives series colour, background gradient, and the change-direction colours used in the value block. Defaults to the ThemeProvider theme, else the default theme of ChartContainer.
'line' (default) or 'bar'
Where to show the value label
Custom format for the value. Same shape as ValueFormatter used elsewhere in the API.
Label text above the value
Sublabel text below the value (defaults to the change %)
Line/bar color override (defaults to theme)
Secondary color for negative bars
Show area fill under line
Fixed Y-axis bounds. Omit a side (or pass 'auto') to keep that edge auto-scaled. Useful to pin a baseline ({ min: 0 }) or hold a stable window so streaming ticks don't rescale the line.
Each bound is an AxisBound: a number, 'auto', a percentage offset string ('+10%'), or a (values) => number reducer.
Chart width in px (default: 140). In a sparkline box sized through style, the chart stretches or shrinks to the free width.
Minimum chart height in px (default: 48). A taller sparkline box (set through style) stretches the chart.
Stroke width in CSS pixels (default: 1)
Show the background gradient across the whole sparkline box (default: false)
Container style override