Treemap Chart

A React squarified SVG treemap with grouped cells under header strips, labels that hide in small cells, hover and keyboard focus with a value tooltip and a hidden data table.

src/registry/ui/treemap-chart.tsx/r/treemap-chart.json

Installation#

bash
npx shadcn@latest add @minidev/treemap-chart

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/treemap-chart.json

Usage#

tsx
import { TreemapChart } from "@/components/ui/treemap-chart"

export function Example() {
  return <TreemapChart />
}

API reference#

TreemapChart props
PropTypeDefault
dataTreemapNode[]SAMPLE
titlestring"Revenue by product line"
captionstring"October, by plan"
heightnumber320
format(value: number) => stringdefaultFormat
minLabelSizenumber44
classNamestring-
All chart components