A squarified treemap of groups and leaves, shaded in five steps from field to ink, with labels where they fit; clicking a group zooms it to the whole area while boxes glide, and Esc zooms out.
pnpm dlx shadcn@latest add @beautiful-ui-pro/treemapNeeds 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 { Treemap, TreemapScale, type TreemapGroup } from "@/components/ui/notchset/treemap";
// shade: 0–1, here the change vs last month (0.5 is flat).
const spend: TreemapGroup[] = [
{ label: "Planner", children: [{ label: "search_docs", value: 3.4, shade: 0.6, sub: "+12% VS AUG" }, { label: "web_fetch", value: 1.9, shade: 1, sub: "+38% VS AUG" }] },
{ label: "Triage", children: [{ label: "classify", value: 2.2, shade: 0.55 }, { label: "other", value: 0.8, shade: 0.3 }] },
];
export function SpendMap() {
return <Treemap data={spend} format={(v) => `$${v}K`} rootLabel="ALL AGENTS" legend={<>CHANGE VS AUG <TreemapScale /></>} />;
}data–
{ label, children: { label, value, shade, sub?, detail? }[] }[]Groups and leaves; shade 0–1.
format–
(v) => stringValues.
rootLabel / hint / legend–
ReactNodeBreadcrumb root, readout hint, legend.
components/ui/notchset/treemap.tsx
This component is included with Pro.
Try the live preview above. Get Pro to install the source.