Sparkline

Compact inline sparkline for embedding trend data in dashboards or KPI cards.

Category: chart · WCAG 2.1-AA · chart, sparkline, inline, trend, data-viz

Props

PropTypeDefaultDescription
datanumber[]Array of numeric values
labelstringAccessible name for the chart (invisible — rendered as the SVG `<title>`).
ariaLabelstringAlias for `label` (the catalog convention for an invisible accessible name). Both work; pass exactly one.
widthnumber120SVG width in px. **This chart is fixed-width by default** — it is a compact, inline chart meant to sit in a table cell or beside a label, so omitting `width` gives you 120px rather than a container-filling chart. Pass a number to change it. The catalogue-wide "omit for a responsive chart" note does not apply to this chart.
heightnumber32SVG height in px. Unlike `width`, height does NOT track the container — this is the knob you set to change the chart's aspect.
colorstring'var(--cascivo-chart-1)'Stroke color (CSS value)
endDotbooleantrueShow dot at last data point

Design tokens

When to use

When not to use

Examples

Inline sparkline

import { Sparkline } from '@cascivo/charts'

<Sparkline data={[10, 20, 15, 30, 25]} label="Trend" endDot />

Related components

← Back to docs