Mermaid Syntax Reference
- Mermaid Flowchart Syntax
A flowchart declaration opens with graph or flowchart followed by a direction, then one relationship per line.
- Mermaid Sequence Diagram Syntax
A sequence diagram opens with sequenceDiagram, then declares participants and lists their messages in the order they happen.
- Mermaid Class Diagram Syntax
A class diagram opens with classDiagram, then declares class bodies and the relationship arrows between them.
- Mermaid ER Diagram Syntax
An ER diagram opens with erDiagram, then lists relationships between entities and, optionally, each entity's attribute block.
- Mermaid Gantt Chart Syntax
A Gantt chart opens with gantt, sets a dateFormat, then lists tasks grouped into sections with a start and a duration or a dependency.
- Mermaid State Diagram Syntax
A state diagram opens with stateDiagram-v2, then lists transitions between states as arrows, optionally labelled with the triggering event.