Treemap
Part-to-whole where parts vary by orders of magnitude. Squarified layout; labels carry the precision.
Signature
Density
Viewport
Theme and light/dark are set in the top barWhen to use
Part-to-whole where parts vary by orders of magnitude.
Accessibility
Each chart ships an accessible fallback (a visually-hidden data table / aria-label summary) so the data is available to screen readers, not just sighted users. Colour is paired with shape/label, never used alone.
Install and import
npx shadcn@latest add @prism/treemap
import { Treemap } from '@/components/prism/Treemap';
In a no-build prototype, read it from the bundle instead: const { Treemap } = window.PrismDesignSystem_39d121;
Props
| Prop | Type | Required | Description |
|---|---|---|---|
items | TreemapItem[] | Yes | |
height | number | — | |
formatValue | (value: number) => React.ReactNode | — | |
showShare | boolean | — | Append each tile's share of the total. Default true. |
caption | string | — | |
className | string | — |