One hundred squares, each a percent, filled column by column in ink tones and a hatch; new shares ripple across the grid, and hovering a legend row isolates its squares.
pnpm dlx shadcn@latest add @beautiful-ui-pro/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.
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.
Import it and pass your content. The props that matter most are listed next.
import { WaffleChart } from "@/components/ui/notchset/waffle-chart";
// Whole percentages that add up to 100.
const byModel = [
{ label: "Atlas 3 Flash", share: 58 },
{ label: "Atlas 3", share: 22 },
{ label: "Atlas 3 Pro", share: 11 },
{ label: "Atlas 2", share: 6 },
{ label: "Embeddings", share: 3 },
];
export function SpendByModel() {
return <WaffleChart data={byModel} total={528} />;
}data–
{ label, share }[]Whole percentages totalling 100.
total–
numberFor each row's amount.
format–
(v) => stringAmounts.
components/ui/notchset/waffle-chart.tsx
This component is included with Pro.
Try the live preview above. Get Pro to install the source.