Mermaid Reference IDE (Hybrid Edition)
A practical, powerful IDE for Mermaid 10.9.5
Diagrams as code · Live playground · Advanced operations
1. What Mermaid Is
Reference + IDEPlain text in, animated diagrams out—versionable, searchable, themeable.
Mermaid is a “diagrams as code” tool. You write plain text, and Mermaid renders diagrams such as:
- Flowcharts, sequence diagrams, class diagrams, and state machines
- ER diagrams, journey diagrams, Gantt charts, pies, timelines, and mindmaps
This page is a full-featured Mermaid IDE: live editors, theme engine, exports, and advanced operations.
2. Setup & Initialization
HTML · Markdown · SPA
CDN
Global init
Per-diagram overrides
2.1. Include the CDN Script
<script src="https://unpkg.com/mermaid@10.9.5/dist/mermaid.min.js"></script>
2.2. Global Initialization
<script>
mermaid.initialize({
startOnLoad: true,
theme: "dark"
});
</script>
3. Diagram Gallery
All core types3.1. Flowchart
flowchart LR
A[Start] --> B{Decision?}
B -->|Yes| C[Continue]
B -->|No| D[Stop]
3.2. Sequence Diagram
sequenceDiagram
actor User
participant Browser
participant Server
User->>Browser: Open page
Browser->>Server: Request data
Server-->>Browser: JSON response
Browser-->>User: Render UI
3.3. Class Diagram
classDiagram
class User {
+string name
+login()
}
class Session {
+string token
}
User --> Session : creates
3.4. State Diagram
stateDiagram-v2
[*] --> Idle
Idle --> Running : start()
Running --> Idle : stop()
3.5. ER Diagram
erDiagram
USER ||--o{ ORDER : places
ORDER ||--|{ ITEM : contains
3.6. Journey Diagram
journey
title User Journey
section Discover
Finds site: 4
Reads docs: 5
section Use
Tries feature: 3
Fixes error: 2
3.7. Gantt Chart
gantt
dateFormat YYYY-MM-DD
title Project Plan
section Phase 1
Setup :done, p1, 2024-01-01, 3d
Build :active, p2, 2024-01-04, 5d
3.8. Pie Chart
pie showData
title Usage Breakdown
"Docs" : 40
"UI" : 30
"Backend" : 20
"Other" : 10
3.9. Timeline
timeline
title Release Timeline
2024-01 : Alpha
2024-03 : Beta
2024-06 : Launch
3.10. Mindmap
mindmap
root((Project))
Planning
Research
Requirements
Build
Frontend
Backend
Deploy
Testing
Release
4. Natural Language & Code Intelligence
A · FDescribe diagrams in English, get Mermaid code and explanations.
Natural Language → Mermaid
Type what you want; get a starting Mermaid diagram.
Mermaid → Explanation
Paste Mermaid code; get a human-readable explanation.
5. Advanced Mermaid Editor
A · B · C · ESplit-pane editor, validation, theme-aware colors, SVG/PNG export, keyboard shortcuts.
Flowchart IDE
Ctrl+Enter: Generate · Ctrl+S: Export SVG · Ctrl+Shift+P: Export PNG
flowchart LR
A[Start] --> B{Decision?}
B -->|Yes| C[Continue]
B -->|No| D[Stop]
6. Customization Lab
A · C · E · GEach card is a mini IDE: theme-aware colors, validation, SVG/PNG export, dashboard-aware.
Flowchart Lab
Branching logic, decisions, and paths.
flowchart LR
A[Start] --> B{Decision?}
B -->|Yes| C[Continue]
B -->|No| D[Stop]
Sequence Lab
Calls between actors and services.
sequenceDiagram
actor User
participant Browser
participant Server
User->>Browser: Open page
Browser->>Server: Request data
Server-->>Browser: JSON response
Browser-->>User: Render UI
Class Diagram Lab
Types, methods, and relationships.
classDiagram
class User {
+string name
+login()
}
class Session {
+string token
}
User --> Session : creates
State Diagram Lab
States, transitions, and events.
stateDiagram-v2
[*] --> Idle
Idle --> Running : start()
Running --> Idle : stop()
ER Diagram Lab
Entities, relationships, and cardinality.
erDiagram
USER ||--o{ ORDER : places
ORDER ||--|{ ITEM : contains
Journey Lab
User journeys and experience scores.
journey
title User Journey
section Discover
Finds site: 4
Reads docs: 5
section Use
Tries feature: 3
Fixes error: 2
Gantt Lab
Timelines, phases, and durations.
gantt
dateFormat YYYY-MM-DD
title Project Plan
section Phase 1
Setup :done, p1, 2024-01-01, 3d
Build :active, p2, 2024-01-04, 5d
Pie Lab
Quick breakdowns and proportions.
pie showData
title Usage Breakdown
"Docs" : 40
"UI" : 30
"Backend" : 20
"Other" : 10
Timeline Lab
Releases, milestones, and history.
timeline
title Release Timeline
2024-01 : Alpha
2024-03 : Beta
2024-06 : Launch
Mindmap Lab
Ideas, branches, and structure.
mindmap
root((Project))
Planning
Research
Requirements
Build
Frontend
Backend
Deploy
Testing
Release
Dashboard & Batch Operations
Filter diagrams, export all, and generate embed snippets.
7. Quick Reference
Cheat sheetCore diagram keywords:
flowchart LR,sequenceDiagram,classDiagram,stateDiagram-v2erDiagram,journey,gantt,pie,timeline,mindmap
Keyboard shortcuts (advanced editor):
Ctrl+Enter— Generate previewCtrl+S— Export SVGCtrl+Shift+P— Export PNG
Comments
Post a Comment