Skip to content
caliper ui pro docs

Treemap

Nested rectangles sized by value, with drill-down.

Pro
Storage by team

Area is share. Open a group to see what it holds.

Storage by team
ItemGroupValueShare
Figma filesDesign4223.9%
ExportsDesign1810.2%
BuildsEngineering6436.4%
LogsEngineering3017.0%
OperationsAll2212.5%

When to use

  • Showing parts of a whole across two levels.
  • Many categories where a pie would be unreadable.

When not to use

  • Precise comparison of similar values.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/treemap

Adds its 5 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

API reference

Treemap

9 props
PropTypeDefaultDescription
label *string—
data *readonly TreemapNode[]—
rootLabelstring"All"
unitstring""
formatValue((value: number) => string)numberText
onSelect((node: TreemapNode, trail: readonly string[]) => void)—Called when a leaf is chosen, with the groups that contain it.
loadingboolean—
errorstring—
classNamestring—

layoutTreemap

0 props

No props of its own; it accepts the native props of its root element.

Keyboard

Escape
Closes or cancels, then returns focus to where it came from.
Backspace
Removes the previous character or item.
Home
Jumps to the first item or the minimum.
End
Jumps to the last item or the maximum.
→
Moves to the next item or value.
←
Moves to the previous item or value.
↓
Moves to the next item or value.
↑
Moves to the previous item or value.

Accessibility

It exposes group and status semantics, with aria-label, aria-busy, aria-hidden, aria-current and aria-pressed kept in step with state. Changes that matter are announced through a live region.

Notes for AI

Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.

/docs/components/treemap.md

The index of every part is at /llms.txt.

More in Distribution charts