AI · MCP Server and Agent Skills included

React TreeMap for hierarchies, now easier to build with AI

Show hierarchical or flat data as nested rectangles sized by value, with four layouts, drill-down, range, equal, and desaturation color mapping, label templates, legends, tooltips, selection, and export. AI assistants set it up for you from the current docs.

  • 190K+ npm downloads
  • 4.5/5 850+ G2 reviews
  • 4.6/5 950+ Capterra reviews
  • WCAG 2.2 accessible
  • 4 layout types

Trusted by the world’s leading companies

Syncfusion customers include Visa, Apple, McDonald’s, Netflix, Starbucks, IBM, Tesla, and Schneider Electric

Now easier with AI

Build treemaps faster with AI

Coding assistants write the TreeMap setup from the current docs instead of guessing.

01For developers

Describe a hierarchy and get code that uses the documented API

The Syncfusion MCP server and Agent Skills give assistants in VS Code, Cursor, and JetBrains the current TreeMap docs and recommended patterns.

See all 34 features

AI coding assistantMCP Server · Syncfusion React

Show car sales grouped by country, sized by sales.

search_docs“React TreeMap levels and weights” · 2 doc sections

Excerpt: imports and sample data omitted.

<TreeMapComponent dataSource={sales}

weightValuePath="sales"

leafItemSettings={{ labelPath: 'brand' }}>

<LevelsDirective>

<LevelDirective groupPath="country" />

</LevelsDirective>

</TreeMapComponent>

Documented API: weightValuePath, LevelDirective, groupPath, labelPath

ResultRendered in your app

AI coding assistantMCP Server · Syncfusion React

Lay out the items as vertical slices.

search_docs“React TreeMap layout types” · 2 doc sections

Excerpt: imports and sample data omitted.

<TreeMapComponent dataSource={gdp} weightValuePath="gdp"

layoutType="SliceAndDiceVertical" />

Documented API: layoutType

ResultRendered in your app

AI coding assistantMCP Server · Syncfusion React

Let users drill into each region and show a breadcrumb trail.

search_docs“React TreeMap drill-down with breadcrumbs” · 2 doc sections

Excerpt: imports and sample data omitted.

<TreeMapComponent dataSource={staff}

weightValuePath="count"

enableDrillDown={true} enableBreadcrumb={true}

breadcrumbConnector=" > ">

<LevelsDirective>…</LevelsDirective>

</TreeMapComponent>

Documented API: enableDrillDown, enableBreadcrumb, breadcrumbConnector

ResultRendered in your app

AI coding assistantMCP Server · Syncfusion React

Color countries by population growth: orange from 0 to 500, green from 500 to 4,000.

search_docs“React TreeMap range color mapping” · 2 doc sections

Excerpt: imports and sample data omitted.

<TreeMapComponent rangeColorValuePath="growth"

leafItemSettings={{

colorMapping: [

{ from: 0, to: 500, color: 'orange' },

{ from: 500, to: 4000, color: 'green' }] }} />

Documented API: rangeColorValuePath, colorMapping

ResultRendered in your app

AI coding assistantMCP Server · Syncfusion React

Color each state by its winning party and add a legend at the top.

search_docs“React TreeMap equal color mapping and legend” · 2 doc sections

Excerpt: imports and sample data omitted.

<TreeMapComponent equalColorValuePath="winner"

legendSettings={{ visible: true, position: 'Top' }}>

<Inject services={[TreeMapLegend]} />

</TreeMapComponent>

Documented API: equalColorValuePath, legendSettings, TreeMapLegend

ResultRendered in your app

AI coding assistantMCP Server · Syncfusion React

Show the sport and medal count in each item with a custom template.

search_docs“React TreeMap labels and templates” · 2 doc sections

Excerpt: imports and sample data omitted.

<TreeMapComponent

leafItemSettings={{ labelPath: 'sport',

labelFormat: '${sport} - ${gold}',

interSectAction: 'WrapByWord',

labelTemplate: medalTemplate }} />

Documented API: labelFormat, labelTemplate, interSectAction

ResultRendered in your app

AI coding assistantMCP Server · Syncfusion React

Highlight items on hover and select them on click.

search_docs“React TreeMap selection and highlight” · 2 doc sections

Excerpt: imports and sample data omitted.

<TreeMapComponent

selectionSettings={{ enable: true, fill: '#58a0d3' }}

highlightSettings={{ enable: true, fill: '#a5c8e8' }}>

<Inject services={[TreeMapSelection, TreeMapHighlight]} />

</TreeMapComponent>

Documented API: selectionSettings, highlightSettings

ResultRendered in your app

AI coding assistantMCP Server · Syncfusion React

Add buttons that export the treemap to PDF and print it.

search_docs“React TreeMap print and export” · 2 doc sections

Excerpt: imports and sample data omitted.

<TreeMapComponent ref={map} allowPdfExport={true}

allowPrint={true}>

<Inject services={[PdfExport, Print]} />

</TreeMapComponent>

map.current?.export('PDF', 'sales');

map.current?.print();

Documented API: allowPdfExport, allowPrint, export, print

ResultRendered in your app

Features in depth

React TreeMap features in depth

Open a demo to try each one, or the docs to see the API.

Data binding: hierarchical and flat data

Bind nested or flat records with dataSource and size each item with weightValuePath. Leaf items are the rectangles, sized and colored from the values you assign.

Levels with headers and templates

Each LevelDirective groups items by a groupPath. Style its header with headerFormat, headerStyle, and headerHeight, render a headerTemplate, and set the gap between groups.

Layouts: squarified and slice and dice

layoutType draws square-like rectangles with Squarified, the default, or long thin rectangles with SliceAndDiceHorizontal, SliceAndDiceVertical, or SliceAndDiceAuto.

Drill-down to child items

Set enableDrillDown so users open a parent to see its children in detail. enableBreadcrumb adds a trail for returning to upper levels.

Color mapping: range, equal, and desaturation

Color items by numeric ranges, by equal values such as a winning candidate, or by desaturation from high to low. Palettes color items when no mapping applies.

Data labels and label templates

labelPath and labelFormat set the text, and interSectAction trims, hides, or wraps labels wider than their item. labelTemplate renders any HTML, even a pie chart.

Legend: default and interactive

A default legend shows swatches for each category. The interactive mode points to the range of the hovered item, and position, size, shape, and paging are adjustable.

Tooltips, selection, and highlight

Tooltips show an item's values on hover or tap. selectionSettings and highlightSettings set the fill, border, and opacity of selected and hovered items.

Print and export to images or PDF

Export the treemap to PNG, JPEG, SVG, or PDF on the client with the export method, or print it from the browser.

Accessible, localized, right-to-left, and themed

Keyboard navigation and screen reader support meet WCAG 2.2. enableRtl mirrors nodes, headers, labels, and legends, numbers follow the locale, and themes include Tailwind CSS, Bootstrap, Material, and Fluent.

Get started

Get your first treemap running, with or without AI

With an AI coding assistant

  1. Connect the Syncfusion MCP serverWorks in VS Code, Cursor, JetBrains, and other MCP-compatible assistants.Set up the MCP server
  2. Add Agent Skills to your projectYour agent follows Syncfusion’s recommended TreeMap patterns.Install Agent Skills
  3. Describe the treemapCopy this prompt to start.

    Add a Syncfusion React TreeMap to my sales report showing sales by region and country, with drill-down and colors by growth.

By hand, in three steps

1 · Install

npm install @syncfusion/ej2-react-treemap --save

2 · Theme

<TreeMapComponent theme="Tailwind3" />

3 · src/App.tsx

import { TreeMapComponent, LevelsDirective, LevelDirective } from '@syncfusion/ej2-react-treemap';

const sales = [
  { region: 'Europe', country: 'Germany', sales: 340 },
  { region: 'Europe', country: 'France', sales: 280 },
  { region: 'Asia', country: 'Japan', sales: 410 },
  { region: 'Asia', country: 'India', sales: 190 }
];

export default function App() {
  return (
    <TreeMapComponent dataSource={sales} weightValuePath="sales" theme="Tailwind3" leafItemSettings={{ labelPath: 'country' }}>
      <LevelsDirective><LevelDirective groupPath="region" /></LevelsDirective>
    </TreeMapComponent>
  );
}
Read the getting started guide

Works withReact 15.5.4 or laterTypeScript and JavaScriptNext.jsRemixGatsbyVitePreactSystem requirements

Customer reviews

Trusted by developers and teams

G2

4.5/5

From 850+ reviews of Essential Studio®

Read the reviews on G2

“Awesome, enough said”

Easy usability, solving real-life problems, easy to implement. Most of the cases have the operators and settings possibilities you need right away.

Oliver O.Creative and Art Direction, Small Business

“A giant framework with great pricing options”

I have loved the components and options that Syncfusion has; besides, its documentation, demos, and support are excellent.

Alejandro Javier V.CEO, Small Business
75%
lower costs
50%
faster development

Customer story · Igniatek

Igniatek cuts development time 50% and costs 75% with Essential Studio®

“I would definitely recommend Syncfusion for anyone who is trying to develop something meaningful.”

Somnath Maji, Founder, Igniatek Consultancy

Award-winning

Including the 2026 Devies Award, Capterra Shortlist 2026, Software Advice FrontRunners 2026, and G2 Best Software 2025.

Syncfusion awards: 2026 Devies Award Winner, Capterra Shortlist 2026, Software Advice FrontRunners 2026, SaaS Awards 2026 Finalist, Hosting Advice Developers' Choice, A.I. Awards 2025 Finalist, Visual Studio Magazine Readers' Choice 2025 Gold, G2 Best Software 2025, ComponentSource Top 10 Publisher 2025, and TrustRadius Tech Cares 2025

Complete feature list

Every treemap feature, included in the license

  • Every feature includedNo separate enterprise edition
  • Royalty-freeNo runtime or deployment fees
  • Weekly patchesPlus regular feature releases
  • Expert supportFrom Syncfusion engineers

Related data visualization components:React ChartsReact Stock ChartReact HeatMapReact Circular Gauge

Questions and answers

React TreeMap FAQ

What is the React TreeMap?

The Syncfusion React TreeMap shows hierarchical or flat data as nested rectangles, where each rectangle's size shows its value. It adds drill-down, color mapping, labels, legends, and export. Explore the demos

When should I use a treemap instead of a pie or bar chart?

Use a treemap when the data has many items or several levels, such as sales by region and country, because nested rectangles fit more items in less space. React Charts

How do I add a treemap in React?

Install @syncfusion/ej2-react-treemap and render TreeMapComponent with a dataSource and a weightValuePath. Add a LevelDirective for each grouping level. Read the getting started guide

Which layouts are available?

Squarified, slice and dice horizontal, slice and dice vertical, and slice and dice auto, set with layoutType. Layout demo

How does drill-down work?

Set enableDrillDown and users click a parent to see its children. enableBreadcrumb shows the path back to upper levels. Drill-down demo

How do I color items by value?

Set rangeColorValuePath with colorMapping ranges, equalColorValuePath for categories, or minOpacity and maxOpacity for desaturation. Read about color mapping

Can I customize the labels inside items?

Yes. labelFormat combines fields, interSectAction trims, hides, or wraps long labels, and labelTemplate renders any HTML. Label template demo

Does the treemap have a legend?

Yes. Inject TreeMapLegend and set legendSettings.visible. The Interactive mode marks the range of the hovered item. Read about the legend

Can users select or highlight items?

Yes. Inject TreeMapSelection and TreeMapHighlight, then enable selectionSettings and highlightSettings. Selection demo

Can I export or print the treemap?

Yes. The export method saves it as PNG, JPEG, SVG, or PDF on the client, and print prints it from the browser. Print and export demo

Is the React TreeMap accessible?

Yes. It supports keyboard navigation and screen readers, meets WCAG 2.2 and Section 508, and renders right to left. Read about accessibility

Can AI coding assistants build with the React TreeMap?

Yes. The Syncfusion MCP server and Agent Skills give assistants in VS Code, Cursor, and JetBrains the current TreeMap docs and recommended patterns. You need a Syncfusion API key and an active license, which can be a commercial, Community, or trial license. Set up the MCP server

Is the Syncfusion React TreeMap free?

It is a commercial component with a 30-day free trial. A free Community License is available for companies and individuals with less than $1 million USD in annual gross revenue, five or fewer developers, and 10 or fewer total employees. Check Community License eligibility

Syncfusion React TreeMap

Build your React treemaps faster with AI

The full TreeMap, the MCP server, and Agent Skills, free for 30 days.

  • No credit card required
  • Free Community License for eligible teams
  • No runtime or deployment fees