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
A grid of soft squares where each square stands for an equal share.
npx shadcn@latest add ikislay/pixel-ui/waffle-chartimport { WaffleChart } from "@/components/ui/waffle-chart"const data = [{ label: "Renewed", value: 62 },{ label: "Upgraded", value: 14 },]export function Demo() {return <WaffleChart label="Subscriptions this year" data={data} total={100} />}
1// Loading…
Options you can pass to customize this component.
data*{ label: string; value: number; color?: string }[]One part per entry, filled in order. Squares are rounded so the parts always fill the grid exactly.
label*stringNames the chart for screen readers and captions its data table.
totalnumberThe amount the whole grid stands for. Above the sum of the parts, the rest of the grid stays empty.
columnsnumberSquares per row.
rowsnumberRows of squares.
format(value: number) => stringFormats values wherever the chart shows them. Defaults to short numbers like 12.4K.
classNamestringMerged onto the root element.