Skip to main content

Supported Mermaid diagram types

The Mermaid diagram type is detected from the first keyword, so the Mermaid description must start with one of the keywords below.

DiagramStart your source with
Flowchartflowchart or graph
Class diagramclassDiagram
State diagramstateDiagram / stateDiagram-v2
Sequence diagramsequenceDiagram
ZenUML sequencezenuml
Entity-Relationship (ER)erDiagram
Requirement diagramrequirementDiagram
C4 modelC4Context / C4Container / C4Component / C4Dynamic / C4Deployment
Gantt chartgantt
User journeyjourney
Kanban boardkanban
Timelinetimeline
Git graphgitGraph
Pie chartpie
XY chart (bar / line)xychart-beta
Quadrant chartquadrantChart
Radar chartradar / radar-beta
Sankey diagramsankey / sankey-beta
Treemaptreemap / treemap-beta
Mindmapmindmap
Block diagramblock / block-beta
Packet diagrampacket / packet-beta
Architecture diagramarchitecture / architecture-beta
Venn diagramvenn
Ishikawa / fishboneishikawa or fishbone
Tree viewtreeView
Wardley mapwardley / wardley-beta
Event Modelingeventmodeling / eventmodeling-beta

If the text starts with a keyword that isn't in this list, draw.io reports it as an unsupported diagram type. If it is a supported type but the body can't be parsed, you get a parse error pointing at the problem.

Frontmatter to define diagram type options

Mermaid configuration, such as %%{init}%% directives and comments, are ingnored until the first valid diagram type keyword is found.

For example, when flowchart is read on the second line, the init options will then be evaluated and applied if they are valid for that diagram type.

%%{init: {"flowchart": {"defaultRenderer": "elk"}} }%%
flowchart LR
A --> B --> C