Back to Docs
Creating Diagrams
Mermaid basics
Mermaid uses simple text to create diagrams. Each diagram starts with a type declaration.
Flowcharts
The most common diagram type. Perfect for processes and workflows.
flowchart TD
Start --> Process --> EndDirection options:
TDorTB— Top to bottomLR— Left to rightBT— Bottom to topRL— Right to left
Shapes
Different brackets create different shapes:
[text]— Rectangle(text)— Rounded rectangle(curly braces around text)— Diamond((text))— Circle
Connections
Connect nodes with arrows:
-->— Arrow---— Line without arrow-.->-— Dotted arrow==>>— Thick arrow
Adding labels
Add text to your connections:
A -->|Yes| B
A -->|No| COther diagram types
MermaidSnap supports many diagram types:
- Sequence diagrams — Show interactions between systems
- Class diagrams — Show code structure
- State diagrams — Show states and transitions
- ER diagrams — Show database relationships
- Gantt charts — Show project timelines
- Pie charts — Show proportions
- Mindmaps — Organize ideas