Waffle ChartProv1.0.0
Parts of a whole as a ten by ten grid where every square is one percent, so a share is something you can count. Squares keep their place when the data change and only the ones that change hands recolour; the list beside it gives each share and value.
pnpm dlx shadcn@latest add @beautiful-ui-pro/lumen-waffle-chartNeeds your registry key. Your components.json style picks the Base UI or Radix build: radix-*, new-york and default get Radix, base-* gets Base UI.
Styles didn't apply?
The CLI adds the styles to the CSS file named in components.json (tailwind.css). Check that it points at your global stylesheet, that the project uses Tailwind CSS v4, and that the file is imported in your root layout. Installed by hand: paste styles.css into that file.
Usage
Import it and pass your content. The props that matter most are listed next.
"use client";
import { WaffleChart } from "@/components/ui/lumen/charts/waffle-chart";
const plans = [
{ plan: "starter", accounts: 412 },
{ plan: "growth", accounts: 268 },
{ plan: "scale", accounts: 96 },
];
const config = {
starter: { label: "Starter", color: "var(--chart-1)" },
growth: { label: "Growth", color: "var(--chart-2)" },
scale: { label: "Scale", color: "var(--chart-3)" },
};
export function PlanMix() {
return <WaffleChart data={plans} name="plan" value="accounts" config={config} label="Accounts by plan" />;
}Props
data / name / value–Row[] / field / fieldOne row per group: its name and amount. Shares come from the total.
config–ChartConfigColour and label per group name. Unlisted groups take the series colours in order.
size10numberSquares per side; 10 gives one square per percent.
legend"list""list" | "none"Each group's share and value beside the grid (below on narrow cards).
gridSize260numberThe grid's largest width in px.
valueFormat–StatFormat | (n) => stringValues in the list, table and summary.
Show all 9 propsShow fewer
active / onActiveChange / onSelect–string | null / (name) => void / (name) => voidThe focused group, controlled; and a group was clicked or Enter pressed.
motion"full""full" | "subtle" | "off"Squares light in fill order; reduced motion always wins.
loading / error / emptyText / label–boolean / string / string / stringStates in words with the height held, and the chart's accessible name.
Source
components/ui/lumen/charts/waffle-chart.tsx
This component is included with Pro.
Try the live preview above. Get Pro to install the source.