Simulates prefers-reduced-motion for the demo. Off follows your system setting.
Steps focus through the demo with ] and [. Tab, arrows, and Escape stay native so the component behaves as shipped.
1
Signups
1,284
| point | Signups over twelve months |
|---|---|
| Jan | 42 |
| Feb | 51 |
| Mar | 48 |
| Apr | 62 |
| May | 58 |
| Jun | 71 |
| Jul | 69 |
| Aug | 84 |
| Sep | 92 |
| Oct | 88 |
| Nov | 104 |
| Dec | 118 |
Active users
8,920
| point | Active users over twelve months |
|---|---|
| Jan | 610 |
| Feb | 640 |
| Mar | 655 |
| Apr | 630 |
| May | 700 |
| Jun | 720 |
| Jul | 760 |
| Aug | 745 |
| Sep | 800 |
| Oct | 830 |
| Nov | 870 |
| Dec | 892 |
Refunds
37
| point | Refunds over twelve months |
|---|---|
| Jan | 9 |
| Feb | 7 |
| Mar | 8 |
| Apr | 6 |
| May | 7 |
| Jun | 5 |
| Jul | 6 |
| Aug | 4 |
| Sep | 5 |
| Oct | 4 |
| Nov | 3 |
| Dec | 4 |
A tiny line with no axes that shows a trend at a glance.
npx shadcn@latest add ikislay/pixel-ui/sparklineimport { Sparkline } from "@/components/ui/sparkline"export function Demo() {return (<div className="w-40"><Sparkline label="Signups this week" data={[12, 18, 15, 22, 27, 24, 31]} /></div>)}
1// Loading…
Options you can pass to customize this component.
data*number[]The values, oldest first.
labelsstring[]A label for each value, shown in the tooltip. Without it the tooltip shows only the value.
label*stringNames the chart for screen readers and captions its data table.
colorstringAny CSS color for the line and its fill.
heightnumberHeight in pixels. The width fills the parent.
format(value: number) => stringFormats values wherever the chart shows them. Defaults to short numbers like 12.4K.
classNamestringMerged onto the root element.