Back to dashboards
ComponentChartFree

Treemap Chart React component

A squarified treemap of a two-level hierarchy: tile area follows value, tiles are coloured by growth from red through neutral to green, groups carry labelled headers, and clicking a group zooms into it with tiles gliding to their new places.

About the Treemap Chart component

Treemap Chart shows how a total splits into groups and items as nested rectangles whose area follows value, so the biggest contributors jump out. Tiles are coloured by growth (red to green) or by group, and every group has a header with its total.

Click a group, its header or press Enter to zoom in: the tiles glide to their new places and a breadcrumb takes you back. Hover, tap or use the arrow keys for each tile's share of its group and of the total.

When to use it

Use it for revenue by region and product, cloud spend by team and service, portfolio holdings by sector, disk usage, budgets and any two-level breakdown with more items than a pie chart can hold.

Treemaps compare sizes well but not tiny differences; for exact ranking, add a sorted bar chart next to it.

Installation

Add the Treemap Chart component to your project with the shadcn CLI. It lands in components/treemap-chart.tsx as plain React + Tailwind CSS source you own and can edit.

Install
Copied!
npx shadcn@latest add @reactframe/treemap-chart

Or copy the source by hand and install its dependencies:

Install
Copied!
npm install clsx tailwind-merge

More Chart components

Sankey Diagram
Free
Waterfall Chart
Free
Contribution Heatmap
Free
Funnel Chart
Free
Radial Bar Chart
Free
Candlestick Chart
Free