Treemap
Nested rectangles sized by value, with drill-down.
Area is share. Open a group to see what it holds.
| Item | Group | Value | Share |
|---|---|---|---|
| Figma files | Design | 42 | 23.9% |
| Exports | Design | 18 | 10.2% |
| Builds | Engineering | 64 | 36.4% |
| Logs | Engineering | 30 | 17.0% |
| Operations | All | 22 | 12.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
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
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.mdThe index of every part is at /llms.txt.