10 diagram types · Copy-paste ready
Quick-reference syntax for every Mermaid diagram type. Click "Try in Editor" on any example to open it live.
Download printable PDF cheatsheet
Directional graphs for process flows, decision trees, and system architecture.
flowchart TD
A[Start] --> B{Is it working?}
B -->|Yes| C[Ship it]
B -->|No| D[Debug]
D --> B
C --> E(Done)Show interactions between participants over time, ideal for API and protocol documentation.
sequenceDiagram
participant C as Client
participant S as Server
participant DB as Database
C->>S: POST /login
S->>DB: SELECT user WHERE email=?
DB-->>S: User record
S-->>C: 200 OK + JWT tokenProject timelines with tasks, dependencies, milestones, and status tracking.
gantt
title Project Timeline
dateFormat YYYY-MM-DD
section Design
Wireframes :done, des1, 2024-01-01, 2024-01-07
Mockups :active, des2, 2024-01-08, 5d
section Development
Frontend :dev1, after des2, 10d
Backend :dev2, after des2, 14d
section Launch
Deploy :milestone, 2024-02-15, 0dDatabase schemas with entities, attributes, and relationship cardinalities.
erDiagram
USER {
int id PK
string email
string name
date created_at
}
POST {
int id PK
string title
text body
int user_id FK
}
USER ||--o{ POST : "writes"Object-oriented class hierarchies with inheritance, composition, and method signatures.
classDiagram
class Animal {
+String name
+int age
+makeSound() void
}
class Dog {
+String breed
+fetch() void
}
class Cat {
+bool indoor
+purr() void
}
Animal <|-- Dog
Animal <|-- CatFinite state machines showing states, transitions, and conditions.
stateDiagram-v2
[*] --> Idle
Idle --> Processing : submit
Processing --> Success : valid
Processing --> Error : invalid
Error --> Idle : retry
Success --> [*]
note right of Processing
Validating input
and calling API
end noteProportional data as a circular chart with labeled slices.
pie title Browser Market Share
"Chrome" : 65.3
"Safari" : 18.7
"Firefox" : 4.1
"Edge" : 4.2
"Other" : 7.7Visualize git branch history, merges, and commits with tags.
gitGraph
commit id: "initial"
branch feature/auth
checkout feature/auth
commit id: "add login"
commit id: "add JWT"
checkout main
merge feature/auth
commit id: "bump version"Hierarchical radial diagrams for brainstorming and topic breakdowns.
mindmap
root((FlowViz))
Features
Real-time preview
SVG export
Theme switching
Diagram Types
Flowchart
Sequence
Gantt
Tech Stack
Vue 3
Mermaid v11
Nuxt 3Chronological event sequences grouped into sections by period.
timeline
title Product Roadmap
section 2024 Q1
Jan : Beta launch
Feb : User feedback
Mar : v1.0 release
section 2024 Q2
Apr : Mobile support
Jun : API access