Start with a proven structure
Open a practical Mermaid example, edit it in the public editor, and export the result.
flowchart LR
Idea[Idea] --> Validate{Customer problem?}
Validate -- No --> Archive[Backlog]
Validate -- Yes --> Prototype[Prototype]
Prototype --> Test{Validation passed?}
Test -- Revise --> Prototype
Test -- Success --> Launch[Launch]flowchart LR
Idea[Idea] --> Validate{Customer problem?}
Validate -- No --> Archive[Backlog]
Validate -- Yes --> Prototype[Prototype]
Prototype --> Test{Validation passed?}
Test -- Revise --> Prototype
Test -- Success --> Launch[Launch]Flowchart
Product decision flow
Map the decisions and feedback loops from idea review to launch.
Edit templateflowchart TD
Alert[Alert Occurs] --> Triage{Severity Triage}
Triage --> Owner[Owner Assign]
Owner --> Mitigate[Impact Mitigation]
Mitigate --> Resolve[Root Cause Resolve]
Resolve --> Review[Post-incident Retrospective]flowchart TD
Alert[Alert Occurs] --> Triage{Severity Triage}
Triage --> Owner[Owner Assign]
Owner --> Mitigate[Impact Mitigation]
Mitigate --> Resolve[Root Cause Resolve]
Resolve --> Review[Post-incident Retrospective]Flowchart
Incident response process
Document detection, triage, mitigation, resolution, and review.
Edit templatesequenceDiagram actor User participant Web participant Clerk participant API User->>Web: Save project Web->>Clerk: getToken() Clerk-->>Web: Session JWT Web->>API: PATCH /projects/:id Note over Web,API: Authorization: Bearer JWT API-->>Web: Save result
sequenceDiagram
actor User
participant Web
participant Clerk
participant API
User->>Web: Save project
Web->>Clerk: getToken()
Clerk-->>Web: Session JWT
Web->>API: PATCH /projects/:id
Note over Web,API: Authorization: Bearer JWT
API-->>Web: Save resultSequence
Authenticated API request
Show how a web app uses a Clerk session token to call an API.
Edit templatesequenceDiagram actor User participant App participant Billing User->>App: Plan Select App->>Billing: Checkout Start Billing-->>User: Payment Screen User->>Billing: Payment complete Billing-->>App: Subscription Renewal App-->>User: Paid Features Enable
sequenceDiagram
actor User
participant App
participant Billing
User->>App: Plan Select
App->>Billing: Checkout Start
Billing-->>User: Payment Screen
User->>Billing: Payment complete
Billing-->>App: Subscription Renewal
App-->>User: Paid Features EnableSequence
Checkout sequence
Describe the steps between a shopper, checkout, payment, and fulfillment.
Edit templateclassDiagram
class Project {
+String id
+String ownerId
+String code
+save()
+publish()
}
class Revision {
+String id
+String code
+restore()
}
class FeatureUsage {
+String feature
+Int count
+consume()
}
Project "1" --> "*" Revision
Project "*" --> "1" FeatureUsageclassDiagram
class Project {
+String id
+String ownerId
+String code
+save()
+publish()
}
class Revision {
+String id
+String code
+restore()
}
class FeatureUsage {
+String feature
+Int count
+consume()
}
Project "1" --> "*" Revision
Project "*" --> "1" FeatureUsageClass
Project domain model
Model projects, revisions, comments, and collaborators as domain objects.
Edit templateerDiagram
USER ||--o{ PROJECT : owns
PROJECT ||--o{ REVISION : keeps
USER ||--o{ FEATURE_USAGE : consumes
PROJECT {
string id PK
string ownerId
string title
boolean isPublic
}
REVISION {
string id PK
string projectId FK
string code
}erDiagram
USER ||--o{ PROJECT : owns
PROJECT ||--o{ REVISION : keeps
USER ||--o{ FEATURE_USAGE : consumes
PROJECT {
string id PK
string ownerId
string title
boolean isPublic
}
REVISION {
string id PK
string projectId FK
string code
}ER
SaaS database ERD
Explore a simple relational model for accounts, projects, and billing.
Edit templatestateDiagram-v2 [*] --> Draft Draft --> Saved Saved --> Public: Sharing On Public --> Saved: Sharing Off Saved --> Archived Archived --> Saved: Restore Archived --> [*]: Delete
stateDiagram-v2
[*] --> Draft
Draft --> Saved
Saved --> Public: Sharing On
Public --> Saved: Sharing Off
Saved --> Archived
Archived --> Saved: Restore
Archived --> [*]: DeleteState
Document lifecycle
Track a document from draft through review, publication, and archive.
Edit templatemindmap
root((New Service))
User
Individual
Team
Core value
Fast authoring
Easy sharing
Features
Editor
Templates
Projects
Success metrics
Active User
Saved Projectsmindmap
root((New Service))
User
Individual
Team
Core value
Fast authoring
Easy sharing
Features
Editor
Templates
Projects
Success metrics
Active User
Saved ProjectsMindmap
Service idea mindmap
Expand a product idea into users, problems, features, and validation.
Edit templategantt title Product launch Roadmap dateFormat YYYY-MM-DD section Design User flow :done, ux, 2026-07-28, 2d Data model :done, db, after ux, 1d section Development Live editor :active, editor, after db, 4d Save project :project, after editor, 3d section Launch QA :qa, after project, 2d Public :milestone, launch, after qa, 0d
gantt
title Product launch Roadmap
dateFormat YYYY-MM-DD
section Design
User flow :done, ux, 2026-07-28, 2d
Data model :done, db, after ux, 1d
section Development
Live editor :active, editor, after db, 4d
Save project :project, after editor, 3d
section Launch
QA :qa, after project, 2d
Public :milestone, launch, after qa, 0dGantt
Release roadmap
Plan product releases, milestones, and dependencies on a timeline.
Edit templateC4Context title Mermaid Platform Context Person(user, "User", "Diagram author") System(web, "Web App", "Public Editor and Dashboard") System(api, "API", "Project storage and sharing") System_Ext(auth, "Clerk", "Authentication") Rel(user, web, "Use") Rel(web, api, "HTTPS/JSON") Rel(web, auth, "Sign in")
C4Context
title Mermaid Platform Context
Person(user, "User", "Diagram author")
System(web, "Web App", "Public Editor and Dashboard")
System(api, "API", "Project storage and sharing")
System_Ext(auth, "Clerk", "Authentication")
Rel(user, web, "Use")
Rel(web, api, "HTTPS/JSON")
Rel(web, auth, "Sign in")C4
Platform context map
Explain how users and external systems interact with a platform.
Edit templatestateDiagram-v2 [*] --> Created Created --> Paid: Payment Success Created --> Cancelled: Cancel Paid --> Shipping: Fulfillment Shipping --> Delivered: Fulfillment Done Paid --> Refunded: Refund Delivered --> [*] Cancelled --> [*] Refunded --> [*]
stateDiagram-v2
[*] --> Created
Created --> Paid: Payment Success
Created --> Cancelled: Cancel
Paid --> Shipping: Fulfillment
Shipping --> Delivered: Fulfillment Done
Paid --> Refunded: Refund
Delivered --> [*]
Cancelled --> [*]
Refunded --> [*]State
Order state machine
Show the states and transitions of an order lifecycle.
Edit templateflowchart LR
Visit[Visit service] --> Try[Guest Edit]
Try --> Value{Value moment}
Value -- Yes --> SignUp[Sign up]
Value -- No --> Template[Other Templates]
Template --> Try
SignUp --> Save[Save first project]
Save --> Share[Share with team]flowchart LR
Visit[Visit service] --> Try[Guest Edit]
Try --> Value{Value moment}
Value -- Yes --> SignUp[Sign up]
Value -- No --> Template[Other Templates]
Template --> Try
SignUp --> Save[Save first project]
Save --> Share[Share with team]Flowchart
Customer onboarding flow
Guide a new customer through signup, setup, activation, and support.
Edit templatejourney
title Mermaid Studio Onboarding
section Start
Visit service: 4: User
Example Check: 5: User
Write first code: 4: User
section Success
Save project: 5: User
Share with team: 5: Userjourney
title Mermaid Studio Onboarding
section Start
Visit service: 4: User
Example Check: 5: User
Write first code: 4: User
section Success
Save project: 5: User
Share with team: 5: UserUser Journey
Customer onboarding journey
Map customer actions and sentiment across the onboarding experience.
Edit templatepie title Feature usage share "Editor" : 42 "Templates" : 28 "AI generation" : 20 "Sharing" : 10
pie title Feature usage share
"Editor" : 42
"Templates" : 28
"AI generation" : 20
"Sharing" : 10Pie Chart
Feature usage breakdown
Compare how usage is distributed across product features.
Edit templatequadrantChart title Feature priority x-axis Low impact --> High impact y-axis Low effort --> High effort quadrant-1 Quick wins quadrant-2 Strategic work quadrant-3 Backlog quadrant-4 Needs review Templates: [0.75, 0.65] AI generation: [0.85, 0.8] Comments: [0.45, 0.35]
quadrantChart
title Feature priority
x-axis Low impact --> High impact
y-axis Low effort --> High effort
quadrant-1 Quick wins
quadrant-2 Strategic work
quadrant-3 Backlog
quadrant-4 Needs review
Templates: [0.75, 0.65]
AI generation: [0.85, 0.8]
Comments: [0.45, 0.35]Quadrant
Feature priority quadrant
Position features by value and effort to support prioritization.
Edit templaterequirementDiagram
requirement secure_session {
id: AUTH-01
text: Session tokens must be used for protected API requests
risk: high
verifymethod: test
}
element api_guard {
type: software
}
api_guard - satisfies -> secure_sessionrequirementDiagram
requirement secure_session {
id: AUTH-01
text: Session tokens must be used for protected API requests
risk: high
verifymethod: test
}
element api_guard {
type: software
}
api_guard - satisfies -> secure_sessionRequirement
Authentication requirements
Connect security requirements to the system elements that satisfy them.
Edit templategitGraph commit id: "initial" branch develop checkout develop commit id: "feature" checkout main merge develop commit id: "release"
gitGraph
commit id: "initial"
branch develop
checkout develop
commit id: "feature"
checkout main
merge develop
commit id: "release"GitGraph
Release branching strategy
Visualize branches, merges, and release paths in Git.
Edit templatetimeline
title Mermaid Studio Milestones
2026 Q1 : Editor Launch
2026 Q2 : Save project
: Public link
2026 Q3 : AI Diagramtimeline
title Mermaid Studio Milestones
2026 Q1 : Editor Launch
2026 Q2 : Save project
: Public link
2026 Q3 : AI DiagramTimeline
Product milestones
Present product and company milestones in chronological order.
Edit templatezenuml
title Payment Approve Flow
User->App: Start payment
App->Payment.authorize() {
Payment->Bank: Approve Request
Bank->Payment: Approve Result
}
Payment->App: Payment completezenuml
title Payment Approve Flow
User->App: Start payment
App->Payment.authorize() {
Payment->Bank: Approve Request
Bank->Payment: Approve Result
}
Payment->App: Payment completeZenUML
Payment interaction sequence
Describe the objects and messages involved in a payment flow.
Edit templatesankey Product Budget,Development,120 Product Budget,Design,40 Development,Editor,70 Development,AI Features,50 Design,Research,15 Design,UI Improvements,25
sankey
Product Budget,Development,120
Product Budget,Design,40
Development,Editor,70
Development,AI Features,50
Design,Research,15
Design,UI Improvements,25Sankey
Budget allocation Sankey
Show how a budget flows from sources into teams and initiatives.
Edit templatexychart-beta title "Monthly projects" x-axis [1Month, 2Month, 3Month, 4Month] y-axis "Projects" 0 --> 100 bar [20, 35, 58, 82] line [20, 35, 58, 82]
xychart-beta
title "Monthly projects"
x-axis [1Month, 2Month, 3Month, 4Month]
y-axis "Projects" 0 --> 100
bar [20, 35, 58, 82]
line [20, 35, 58, 82]XY Chart
Monthly metrics chart
Plot monthly values to compare product or business performance.
Edit templateblock
columns 3
Web["Web"] API["API"] DB[("Database")]
Web --> API
API --> DBblock
columns 3
Web["Web"] API["API"] DB[("Database")]
Web --> API
API --> DBBlock
Platform block architecture
Arrange the major blocks that make up a platform.
Edit templatepacket +4: "Version" +4: "IHL" +8: "Service" +16: "Total Length" +32: "Payload"
packet
+4: "Version"
+4: "IHL"
+8: "Service"
+16: "Total Length"
+32: "Payload"Packet
HTTP packet layout
Document the fields and bit widths in an HTTP-like packet.
Edit templatekanban
todo[Todo]
research[Requirements research]
doing[In Progress]
build[Build feature]
done[Done]
release[Prepare release]kanban
todo[Todo]
research[Requirements research]
doing[In Progress]
build[Build feature]
done[Done]
release[Prepare release]Kanban
Sprint Kanban board
Organize sprint work into todo, in progress, and done columns.
Edit templatearchitecture-beta service internet(internet)[Internet] group cloud(cloud)[Cloud] service api(server)[API] in cloud service db(database)[Database] in cloud internet:R -- L:api api:R -- L:db
architecture-beta
service internet(internet)[Internet]
group cloud(cloud)[Cloud]
service api(server)[API] in cloud
service db(database)[Database] in cloud
internet:R -- L:api
api:R -- L:dbArchitecture
Cloud service architecture
Show internet, API, and database deployment relationships.
Edit templateradar-beta
title Diagram tool comparison
axis speed["Speed"], clarity["Clarity"], cost["Cost"]
curve mermaid["Mermaid"]{5, 4, 4}
curve other["Other"]{4, 5, 3}
max 5radar-beta
title Diagram tool comparison
axis speed["Speed"], clarity["Clarity"], cost["Cost"]
curve mermaid["Mermaid"]{5, 4, 4}
curve other["Other"]{4, 5, 3}
max 5Radar
Tool capability radar
Compare diagram tools across speed, clarity, and cost.
Edit templatetreemap-beta
"Product investment"
"Editor": 40
"Sharing": 25
"AI": 35treemap-beta
"Product investment"
"Editor": 40
"Sharing": 25
"AI": 35Treemap
Feature investment treemap
Compare investment across feature areas as nested regions.
Edit templatexychart-beta title "Monthly Revenue" x-axis [1Month, 2Month, 3Month, 4Month] y-axis "Revenue" 0 --> 100 bar [20, 35, 58, 82]
xychart-beta
title "Monthly Revenue"
x-axis [1Month, 2Month, 3Month, 4Month]
y-axis "Revenue" 0 --> 100
bar [20, 35, 58, 82]Bar Chart
Monthly revenue bar chart
Compare monthly revenue with a clear category chart.
Edit templatexychart-beta title "Monthly active users" x-axis [1Month, 2Month, 3Month, 4Month] y-axis "User" 0 --> 100 line [20, 38, 52, 78]
xychart-beta
title "Monthly active users"
x-axis [1Month, 2Month, 3Month, 4Month]
y-axis "User" 0 --> 100
line [20, 38, 52, 78]Line Chart
Monthly active users line chart
Show the growth trend of monthly active users over time.
Edit template