Sparkline

The Sparkline component renders compact trend data for dashboards and dense metric surfaces.

Usage & Examples

Compact Trend

32
compact-trend.tsx
<Sparkline data={[12, 18, 14, 26, 24, 32]} showValue />

Props API

17 props
Columns
Sparkline props API
Default
Description
aria-labelstringNoariaAccessible label for the chart graphic.
classNamestringNostylingAdditional class name for the root.
colorstringNoprops"currentColor"Stroke color for the line.
dataChartDatum[] | number[]YespropsNumeric points or labelled values rendered as a compact line chart.
data-testidstringNotestingBackward-compatible alias for test ID attributes.
heightnumberNoprops48Height of the SVG viewport.
labelReactNodeNopropsVisible label rendered above the sparkline.
loadingbooleanNopropsfalseWhether the component should display a loading state.
paddingnumberNoprops4Inner SVG padding used when plotting points.
showAreabooleanNopropsfalseWhether to fill the area below the line.
showValuebooleanNopropsfalseWhether to render the last value next to the chart.
stateStateTypeNostylingVisual state class used for styling.