Skip to content
Data Display

Sparkline

Tiny inline line, area, or bar trend chart for stat tiles.

Import

tsx
import { Sparkline } from "@cooud-ui/ui";
bash
npx cooud-ui add sparkline

Examples

API Reference

Generated from the component's exported types.

SparklineProps

Extends Omit<SVGAttributes<SVGSVGElement>, "type">

PropTypeDefaultDescription
data*
number[]The series to plot. Order is preserved; values map left→right.
width
number96Intrinsic width of the SVG in px.
height
number28Intrinsic height of the SVG in px.
type
SparklineType"line"Render a connected line or evenly spaced bars.
tone
SparklineTone"primary"Color, mapped to a token via `currentColor`.
area
booleanfalseFor `type="line"`, fill a soft token-tinted gradient under the line.
strokeWidth
number1.5Stroke width of the line (line type only).