Flowchart
flowchartProcesses, decision trees, pipelines, architecture overviews.
flowchart TD
A[Start] --> B{Is it working?}
B -- Yes --> C[Ship it]
B -- No --> D[Debug]
D --> B- •Direction: TD (top-down), LR, RL, or BT.
- •Shapes: [rectangle], (rounded), {diamond}, ((circle)), [(database)].
- •Label an arrow with -- text --> or -->|text|.
Sequence diagram
sequenceDiagramAPI calls, authentication flows, messages between services over time.
sequenceDiagram
participant Browser
participant API
participant DB
Browser->>API: GET /user/42
API->>DB: SELECT * FROM users
DB-->>API: row
API-->>Browser: 200 OK (JSON)- •->> is a solid arrow, -->> a dashed reply.
- •Add notes with Note over API,DB: text.
- •Group steps with loop, alt/else, or opt blocks.
Class diagram
classDiagramObject models, domain models, type hierarchies.
classDiagram
class Animal {
+String name
+speak() void
}
class Dog {
+fetch() void
}
Animal <|-- Dog- •<|-- inheritance, *-- composition, o-- aggregation, --> association.
- •Visibility: + public, - private, # protected, ~ package.
State diagram
stateDiagram-v2UI states, order lifecycles, finite state machines.
stateDiagram-v2
[*] --> Idle
Idle --> Loading: fetch()
Loading --> Success: data
Loading --> Error: failure
Error --> Idle: retry
Success --> [*]- •[*] marks the start and end states.
- •Nest states with state Name { ... }.
Entity relationship diagram
erDiagramDatabase schemas and data models.
erDiagram
CUSTOMER ||--o{ ORDER : places
ORDER ||--|{ LINE_ITEM : contains
CUSTOMER {
string name
string email
}- •||--o{ reads "exactly one to zero or more".
- •List attributes inside { } as type name.
Gantt chart
ganttProject timelines, sprints, release plans.
gantt
title Release plan
dateFormat YYYY-MM-DD
section Backend
API design :done, a1, 2026-01-05, 5d
Implementation :active, a2, after a1, 10d
section Frontend
UI :b1, 2026-01-12, 12d- •dateFormat must match the dates you write.
- •Use after <id> to chain tasks; done, active, and crit change the style.
Pie chart
pieSimple proportions, survey results.
pie title Time spent on a README
"Writing" : 45
"Formatting" : 30
"Fixing broken tables" : 25- •Values are relative — they do not need to add up to 100.
- •Add showData after pie to print the values.
Mindmap
mindmapBrainstorming, topic overviews, outlines.
mindmap
root((Docs))
Guides
Getting started
Tutorials
Reference
API
CLI- •Hierarchy comes from indentation alone.
- •Node shapes work like flowcharts: (( )) circle, [ ] square.
Timeline
timelineRelease history, roadmaps, events in order.
timeline
title Project history
2024 : First release
2025 : Plugin API : 1.0
2026 : Cloud sync- •Each line is period : event; add more events with extra : separators.
Git graph
gitGraphBranching strategies and release workflows in contributing guides.
gitGraph
commit id: "init"
branch feature
checkout feature
commit id: "add login"
checkout main
merge feature
commit id: "v1.0"- •The default branch is main.
- •Use tag: "v1.0" on a commit to label a release.
User journey
journeyUX flows with a satisfaction score per step.
journey
title Signing up
section Discover
Find the site: 5: User
Read the docs: 3: User
section Sign up
Fill the form: 2: User
Confirm email: 4: User- •Each task is name: score (1–5): actors.
Quadrant chart
quadrantChartPrioritization matrices (impact vs. effort).
quadrantChart
title Feature priority
x-axis Low effort --> High effort
y-axis Low impact --> High impact
quadrant-1 Plan
quadrant-2 Do first
quadrant-3 Skip
quadrant-4 Maybe
Dark mode: [0.2, 0.8]
Offline sync: [0.8, 0.7]- •Point coordinates run from 0 to 1 on both axes.
XY chart (bar & line)
xychart-betaSmall bar and line charts inside docs.
xychart-beta
title "Weekly downloads"
x-axis [Mon, Tue, Wed, Thu, Fri]
y-axis "Downloads" 0 --> 500
bar [120, 230, 310, 280, 450]
line [120, 230, 310, 280, 450]- •Still marked beta in Mermaid — syntax may change.