Mermaid mindmaps: the complete syntax template

puml.online

Mermaid mindmaps reached stable in Mermaid 10.5. They use indentation for hierarchy and shape prefixes for node shape — cleaner than PlantUML’s * / ** syntax. This article gives you a copy-pasteable template covering roots, indentation, shapes, icons, theming, and worked examples.

One-liner introduction

1
2
3
4
5
6
7
8
9
10
11
12
mindmap
root((Mermaid mindmap))
Origin
GitHub repo
v10.5 GA
Syntax
indentation = hierarchy
prefix = shape
Use cases
knowledge mapping
project breakdown
decision trees

Source:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
```mermaid
mindmap
root((Mermaid mindmap))
Origin
GitHub repo
v10.5 GA
Syntax
indentation = hierarchy
prefix = shape
Use cases
knowledge mapping
project breakdown
decision trees
```

Root node forms

Syntax Shape When to use
root(text) rounded rectangle default
root((text)) circle emphasise the centre
root[text] rectangle categorical root
root((text))icon:fa fa-book circle + FontAwesome icon branded centre
1
2
3
4
5
6
7
mindmap
root((central topic))
child A
child B
root[category root]
group A
group B

Source:

1
2
3
4
5
6
7
8
9
```mermaid
mindmap
root((central topic))
child A
child B
root[category root]
group A
group B
```

Indentation and depth

Hierarchy is controlled by space indentation. Pick 2 or 4 spaces and stick with it. Mixing tabs and spaces breaks the parser.

1
2
3
4
5
6
7
8
9
mindmap
root((depth))
level one A
level two A1
level three A1a
level three A1b
level two A2
level one B
level two B1

Source:

1
2
3
4
5
6
7
8
9
10
11
```mermaid
mindmap
root((depth))
level one A
level two A1
level three A1a
level three A1b
level two A2
level one B
level two B1
```

Depth is theoretically unlimited, but three levels max is the visual sweet spot.

Node shape prefixes

Prefix the node text to render it in a particular shape:

Prefix Shape
text rounded rectangle (default)
((text)) circle
([text]) stadium
[text] rectangle
((text))) bang / explosion
>text] flag / asymmetric

In practice:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
mindmap
root((shape reference))
default
plain text
circle
((key concept))
stadium
([a long descriptive sentence fits here])
rectangle
[category label]
bang
)))warning)))
flag
>pinned]

Source:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
```mermaid
mindmap
root((shape reference))
default
plain text
circle
((key concept))
stadium
([a long descriptive sentence fits here])
rectangle
[category label]
bang
)))warning)))
flag
>pinned]
```

Icons

Mermaid ships with the FontAwesome icon library. Prefix a node with ::icon(fa fa-xxx) to attach an icon:

1
2
3
4
5
6
7
8
9
10
11
12
13
mindmap
root((system architecture))
Frontend
::icon(fa fa-browser)
React
::icon(fa fa-mobile)
mobile
Backend
::icon(fa fa-server)
Go API
Database
::icon(fa fa-database)
PostgreSQL

Source:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
```mermaid
mindmap
root((system architecture))
Frontend
::icon(fa fa-browser)
React
::icon(fa fa-mobile)
mobile
Backend
::icon(fa fa-server)
Go API
Database
::icon(fa fa-database)
PostgreSQL
```

Common icons: fa fa-book, fa fa-cog, fa fa-rocket, fa fa-bug, fa fa-check, fa fa-times, fa fa-question, fa fa-exclamation.

classDef colours

Same as flowchart: use classDef to style nodes. Scope can be an entire subtree:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
mindmap
root((colour))
security
::icon(fa fa-shield)
HTTPS
::icon(fa fa-lock)
encryption
performance
::icon(fa fa-bolt)
CDN
caching

classDef security fill:#fef3c7,stroke:#92400e,color:#1f2937
classDef performance fill:#dbeafe,stroke:#1e40af,color:#1f2937

class security,performance classDefStyle

Source:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
```mermaid
mindmap
root((colour))
security
::icon(fa fa-shield)
HTTPS
::icon(fa fa-lock)
encryption
performance
::icon(fa fa-bolt)
CDN
caching

classDef security fill:#fef3c7,stroke:#92400e,color:#1f2937
classDef performance fill:#dbeafe,stroke:#1e40af,color:#1f2937

class security,performance classDefStyle
```

Five worked templates

1. Refactor decision tree

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
mindmap
root((should we refactor?))
refactor
::icon(fa fa-check)
cleaner code
::icon(fa fa-check)
long-term maintainability
::icon(fa fa-times)
short-term cost
ship as-is
::icon(fa fa-check)
fast delivery
::icon(fa fa-times)
tech debt
decision criteria
team size
product stability
ROI estimate

2. Learning path

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
mindmap
root((learning Rust))
basics
::icon(fa fa-book)
ownership
borrowing
lifetimes
intermediate
::icon(fa fa-cog)
traits
macros
async
applied
::icon(fa fa-rocket)
web services
CLI tools
embedded

3. Knowledge graph

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
mindmap
root((distributed systems))
theory
CAP
consistency models
Paxos / Raft
communication
RPC
gRPC
message queues
storage
sharding
replication
eventual consistency
orchestration
Kubernetes
service mesh
traffic shaping

4. Production debugging flow

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
mindmap
root((production incident))
symptom
API timeout
data drift
memory spike
locate
::icon(fa fa-search)
logs
::icon(fa fa-chart-line)
metrics
::icon(fa fa-code-branch)
trace
fix
rollback
rate limit
patch
post-mortem
root cause
process fix
monitoring gaps

5. Weekly meeting notes

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
mindmap
root((weekly standup))
done
::icon(fa fa-check)
requirements review
::icon(fa fa-check)
API design
in progress
::icon(fa fa-cog)
backend impl
::icon(fa fa-cog)
frontend integration
blocked
::icon(fa fa-exclamation)
staging env
next week
load test
docs
canary release

Init options

Use %%{init: {...}}%% for global configuration:

1
2
3
4
5
6
7
```mermaid
%%{init: {"theme": "base", "themeVariables": {"fontSize": "14px"}}}%%
mindmap
root((configured))
theme base
fontSize 14px
```
Option Purpose
theme default / base / dark / forest / neutral
themeVariables.fontSize global font size
themeVariables.primaryColor primary accent

Common gotchas

1. Chinese (or non-ASCII) nodes render wrong

Indentation must be spaces only — never tabs. Standardise on 2 spaces.

2. Special characters break the parser

#, &, <, > need to be wrapped in backticks:

1
2
3
4
5
6
```mermaid
mindmap
root((special chars))
contains `&`
contains `#`
```

3. Multiple roots

Mermaid mindmaps do not support multiple roots. For “multiple parallel topics” use a flowchart or split into separate code blocks.

4. Branch direction

Mermaid lays out nodes in declaration order. To force left/right bias, use the _root, _first, _second hints:

1
2
3
4
5
6
7
```mermaid
mindmap
root
_root(centre)
_first first branch
_second second branch
```

Review checklist

  • Indentation uses spaces only (2 or 4), never tabs
  • Depth ≤ 3 levels
  • Key nodes differentiated by shape or icon
  • Colour palette ≤ 3 colours
  • Node text ≤ 8 words (visual clarity)
  • Special characters escaped or backticked
  • Title: Mermaid mindmaps: the complete syntax template
  • Author: puml.online
  • Created at : 2026-09-19 09:00:00
  • Updated at : 2026-09-29 01:06:38
  • Link: https://puml.online/blog/mermaid-mindmap-syntax-template-en/
  • License: This work is licensed under CC BY-NC-SA 4.0.