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
| day | Focus | Meetings |
|---|---|---|
| 27 Jun | 32% | 40% |
| 28 Jun | 25% | 38% |
| 29 Jun | 34% | 41% |
| 30 Jun | 37% | 30% |
| 1 Jul | 37% | 50% |
| 2 Jul | 46% | 22% |
| 3 Jul | 25% | 50% |
Soft capsules stacked in each column, with a hatched cap for what is left of the whole.
npx shadcn@latest add ikislay/pixel-ui/capsule-stack-chartimport { CapsuleStackChart } from "@/components/ui/capsule-stack-chart"const data = [{ day: "27 Jun", focus: 32, meetings: 40 },{ day: "28 Jun", focus: 25, meetings: 38 },{ day: "29 Jun", focus: 34, meetings: 41 },]export function Demo() {return (<CapsuleStackChartlabel="Share of the workday"data={data}index="day"series={[
1// Loading…
Options you can pass to customize this component.
data*Record<string, string | number>[]One object per point along the x axis.
index*stringThe key in each object that labels the x axis.
series*{ key: string; label?: string; color?: string }[]The keys to plot. Colors follow the chart palette in order unless you set one.
label*stringNames the chart for screen readers and captions its data table.
heightnumberHeight in pixels. The width fills the parent.
format(value: number) => stringFormats each value in its pill and the table. Defaults to whole percents.
maxnumberThe amount a full column stands for. The hatched cap fills the gap between a column's sum and this.
classNamestringMerged onto the root element.