Mermaid samples
1. Basic Structure
Every Mermaid diagram starts the same way:
```mermaid
[diagram type] [direction]
[content]
```
2. Main Diagram Types & Syntax Variations
Here are the most useful ones with syntax examples:
Flowchart (most popular)
Direction variations:
TDorTB→ Top to BottomBT→ Bottom to TopLR→ Left to RightRL→ Right to Left
Node shape variations:
A[Text]→ RectangleA(Text)→ RoundedA((Text))→ CircleA[[Text]]→ StadiumA[(Text)]→ CylinderA{{Text}}→ HexagonA[/Text/]→ Parallelogram
Sequence Diagram
Class Diagram
Other Popular Types
Mindmap
Timeline
Gantt Chart
Entity Relationship (ER)
State Diagram
Pie Chart
3. Advanced Syntax Features
- Comments:
%% This is a comment - Styling:
- Subgraphs (grouping nodes):
- Click interactions:
4. Configuration Options
You can add configuration at the top:
Common themes: default, base, dark, forest, neutral.