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">
| Prop | Type | Default | Description |
|---|---|---|---|
data* | number[] | — | The series to plot. Order is preserved; values map left→right. |
width | number | 96 | Intrinsic width of the SVG in px. |
height | number | 28 | Intrinsic 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 | boolean | false | For `type="line"`, fill a soft token-tinted gradient under the line. |
strokeWidth | number | 1.5 | Stroke width of the line (line type only). |