Skip to content
Data & ChartsPro

Treemap

Treemap for the parts of a hierarchy: squarified, nested with group headers, or as an icicle.

Usage

Revenue by line

Revenue by product line: 12 parts, total $1.8M. Largest: Enterprise $410k, Core $340k, Pro $260k.
Revenue by product line, data table
labelValue
Core$340k
Pro$260k
Enterprise$410k
Add-ons$90k
Onboarding$120k
Training$80k
Support$150k
Devices$180k
Accessories$60k
Templates$70k
Plugins$55k
Themes$30k

Installation

Treemap comes with WunderUI Core and Pro, in the package from your plan. See the plans.

Then import what you need:

tsx
import {
  TreemapChart,
  TreemapChartProps,
  TreemapChartVariant,
} from "@wunderui/react"

Examples

Basic Treemap

Revenue by line

Revenue by product line: 12 parts, total $1.8M. Largest: Enterprise $410k, Core $340k, Pro $260k.
Revenue by product line, data table
labelValue
Core$340k
Pro$260k
Enterprise$410k
Add-ons$90k
Onboarding$120k
Training$80k
Support$150k
Devices$180k
Accessories$60k
Templates$70k
Plugins$55k
Themes$30k

Nested Treemap

Revenue by line

Revenue by product line: 12 parts, total $1.8M. Largest: Enterprise $410k, Core $340k, Pro $260k.
Revenue by product line, data table
labelValue
Core$340k
Pro$260k
Enterprise$410k
Add-ons$90k
Onboarding$120k
Training$80k
Support$150k
Devices$180k
Accessories$60k
Templates$70k
Plugins$55k
Themes$30k

Icicle

Revenue by line

Revenue by product line: 16 parts, total $1.8M. Largest: Software $1.1M, Enterprise $410k, Services $350k.
Revenue by product line, data table
labelValue
Software$1.1M
Services$350k
Hardware$240k
Marketplace$155k
Core$340k
Pro$260k
Enterprise$410k
Add-ons$90k
Onboarding$120k
Training$80k
Support$150k
Devices$180k
Accessories$60k
Templates$70k
Plugins$55k
Themes$30k

State – Loading

Revenue by line

Revenue by product line: 12 parts, total $1.8M. Largest: Enterprise $410k, Core $340k, Pro $260k.

State – Hover

Revenue by line

Revenue by product line: 12 parts, total $1.8M. Largest: Enterprise $410k, Core $340k, Pro $260k.
Revenue by product line, data table
labelValue
Core$340k
Pro$260k
Enterprise$410k
Add-ons$90k
Onboarding$120k
Training$80k
Support$150k
Devices$180k
Accessories$60k
Templates$70k
Plugins$55k
Themes$30k

In context

How the component is used inside real screens — the same compositions as the Usage section of the Figma page.

Revenue by Line

Nested treemap of revenue with the top lines.

Revenue by line

Revenue by product line: 12 parts, total $1.8M. Largest: Enterprise $410k, Core $340k, Pro $260k.
Revenue by product line, data table
labelValue
Core$340k
Pro$260k
Enterprise$410k
Add-ons$90k
Onboarding$120k
Training$80k
Support$150k
Devices$180k
Accessories$60k
Templates$70k
Plugins$55k
Themes$30k

Top lines

  • Enterprise
    $410k
  • Core
    $340k
  • Pro
    $260k
  • Devices
    $180k

API Reference

PropTypeDefault
variant"basic-treemap" | "nested-treemap" | "icicle""basic-treemap"
data{ name, value?, color?, children? }—
valueFormatter(v: number) => string—
state"ready" | "loading" | "empty" | "error""ready"
hiddenSeries · animate · animationKeystring[] · boolean · string | number—
activeIndexnumber | null—
animateboolean—
animationKeystring | number—
classNamestring—
defaultActiveIndexnumber | null—
descriptionstring—
heightnumber—
hiddenSeriesreadonly string[]—
labelstring—
onActiveIndexChange(index: number | null) => void—
onRetry() => void—
widthnumber—

Theming

The CSS variables this component reads. Set one on any wrapper to restyle everything inside it. More in Theming.

VariableUsed forDefault
Color
Value#000000dark #FFFFFF
Motion
Duration250ms
Easingcubic-bezier(0.22, 1, 0.36, 1)