merIDK / Diagram types / Treemap
Mermaid treemap: example and syntax
Treemaps show hierarchical data as nested rectangles, each sized by its value. Use them for disk usage, budgets and code size by module.
Open this example in the editor
Example code
treemap-beta
"Frontend"
"React": 40
"CSS": 15
"Backend"
"API": 30
"Workers": 10
"Ops"
"CI": 5
Result
treemap-beta
"Frontend"
"React": 40
"CSS": 15
"Backend"
"API": 30
"Workers": 10
"Ops"
"CI": 5Syntax quick reference
- Parent:
"Name"on its own line. - Leaf:
"Name": value, indented under its parent. - Nest as deep as you need.
How to use it
- Open the example in the editor, or paste your own Mermaid code.
- Edit the code on the left. The preview updates as you type, and errors point to the line.
- Export SVG or PNG, copy a Markdown block for GitHub or Notion, or copy a share link.