flowchart LR
D["Draft guide"] --> R{"Approved?"}
R -->|Yes| P["Publish guide"]
R -->|No| D Loading…
Mermaid 11.15.0
Flowcharts connect actions and decisions into a process. Use swimlane subgraphs to group responsibility, or a sequence diagram when the order of messages between systems is the main point.
Build this in Mermaid Flowchart Editor →Keep ids stable and put display labels in quotes. The shape carries meaning; edges connect the ids.
flowchart LR
D["Draft guide"] --> R{"Approved?"}
R -->|Yes| P["Publish guide"]
R -->|No| D Loading…
| Syntax | Meaning |
|---|---|
| flowchart / graph / LR / RL / TB / TD / BT | Declare the diagram and choose direction. TD and TB both mean top to bottom. |
| A[Text] / A(Text) / A([Text]) / A[[Text]] / A[(Text)] | Legacy rectangle, rounded rectangle, stadium, subroutine and cylinder notation. |
| A((Text)) / A{Text} / A{{Text}} / A>Text] / A(((Text))) | Legacy circle, diamond, hexagon, asymmetric shape and double circle. |
| A[/Text/] / A[\Text\] / A[/Text\] / A[\Text/] | Legacy parallelograms and trapezoids in both orientations. |
| A@{ shape: rect, label: "Text" } | Expanded shape notation: select a canonical name or an alias in the shape catalog below. |
| --> / --- / -.-> / -.- / ==> / === / ~~~ | Arrow, plain link, dotted arrow/link, thick arrow/link and invisible layout link. |
| <--> / o--o / x--x / --o / --x | Bidirectional arrow, circle and cross endpoints. |
| A -->|Label| B / A -- Label --> B / A ----> B | Add edge text or extra dashes for a longer minimum rank span; exact pixel lengths are not fixed. |
| subgraph id [Label] / direction TB / end | Group nodes; external links to internal nodes can override the subgraph direction. |
| classDef / class A,B name / A:::name | Define and apply reusable visual styles. |
| style A / linkStyle 0 / e1@--> / class e1 name | Style a node, a zero-based edge index or a named edge. Named edge styles can also control animation. |
| click A href "URL" / click A callback "Tooltip" | Interactive links and callbacks depend on host security; strict previews disable them. |
| A["`**Bold** and *italic*`"] | Markdown strings support emphasis and automatic wrapping. |
| A@{ icon: "fa:user", form: "square", pos: "t", h: 60 } | Icon nodes require the host to register an icon pack. Square, circle and rounded forms are supported. |
| A@{ img: "/favicon.svg", label: "Text", w: 60, h: 60, constraint: "on" } | Image nodes accept a URL, label, dimensions and aspect-ratio constraint; the image must be reachable. |
| config.layout: elk / config.flowchart.defaultRenderer: elk | ELK is an optional layout renderer; it must be installed and registered by the embedding host. |
| %% / accTitle: / accDescr: | Comments and accessible diagram descriptions. |
| @{ shape: rect } / proc / process / rectangle | Process |
| @{ shape: rounded } / event | Event |
| @{ shape: stadium } / terminal / pill | Terminal Point |
| @{ shape: fr-rect } / subprocess / subproc / framed-rectangle / subroutine | Subprocess |
| @{ shape: cyl } / db / database / cylinder | Database |
| @{ shape: datastore } / data-store | Data Store |
| @{ shape: circle } / circ | Start |
| @{ shape: bang } / bang | Bang |
| @{ shape: cloud } / cloud | Cloud |
| @{ shape: diam } / decision / diamond / question | Decision |
| @{ shape: hex } / hexagon / prepare | Prepare Conditional |
| @{ shape: lean-r } / lean-right / in-out | Data Input/Output |
| @{ shape: lean-l } / lean-left / out-in | Data Input/Output |
| @{ shape: trap-b } / priority / trapezoid-bottom / trapezoid | Priority Action |
| @{ shape: trap-t } / manual / trapezoid-top / inv-trapezoid | Manual Operation |
| @{ shape: dbl-circ } / double-circle | Stop |
| @{ shape: text } | Text Block |
| @{ shape: notch-rect } / card / notched-rectangle | Card |
| @{ shape: lin-rect } / lined-rectangle / lined-process / lin-proc / shaded-process | Lined/Shaded Process |
| @{ shape: sm-circ } / start / small-circle | Start |
| @{ shape: fr-circ } / stop / framed-circle | Stop |
| @{ shape: fork } / join | Fork/Join |
| @{ shape: hourglass } / hourglass / collate | Collate |
| @{ shape: brace } / comment / brace-l | Comment |
| @{ shape: brace-r } | Comment Right |
| @{ shape: braces } | Comment with braces on both sides |
| @{ shape: bolt } / com-link / lightning-bolt | Com Link |
| @{ shape: doc } / doc / document | Document |
| @{ shape: delay } / half-rounded-rectangle | Delay |
| @{ shape: h-cyl } / das / horizontal-cylinder | Direct Access Storage |
| @{ shape: lin-cyl } / disk / lined-cylinder | Disk Storage |
| @{ shape: curv-trap } / curved-trapezoid / display | Display |
| @{ shape: div-rect } / div-proc / divided-rectangle / divided-process | Divided Process |
| @{ shape: tri } / extract / triangle | Extract |
| @{ shape: win-pane } / internal-storage / window-pane | Internal Storage |
| @{ shape: f-circ } / junction / filled-circle | Junction |
| @{ shape: notch-pent } / loop-limit / notched-pentagon | Loop Limit |
| @{ shape: flip-tri } / manual-file / flipped-triangle | Manual File |
| @{ shape: sl-rect } / manual-input / sloped-rectangle | Manual Input |
| @{ shape: docs } / documents / st-doc / stacked-document | Multi-Document |
| @{ shape: st-rect } / procs / processes / stacked-rectangle | Multi-Process |
| @{ shape: bow-rect } / stored-data / bow-tie-rectangle | Stored Data |
| @{ shape: cross-circ } / summary / crossed-circle | Summary |
| @{ shape: tag-doc } / tag-doc / tagged-document | Tagged Document |
| @{ shape: tag-rect } / tagged-rectangle / tag-proc / tagged-process | Tagged Process |
| @{ shape: flag } / paper-tape | Paper Tape |
| @{ shape: odd } | Odd |
| @{ shape: lin-doc } / lined-document | Lined Document |
The catalog covers every standard flowchart shape in the installed 11.15 renderer, including aliases. Use @{ shape: ... } for new shapes; older bracket notation remains valid. Quote labels containing punctuation.
flowchart TB
A@{ shape: sl-rect, label: "Enter title" }
B@{ shape: doc, label: "Draft document" }
C@{ shape: diam, label: "Complete?" }
D@{ shape: cyl, label: "Archive" }
A --> B --> C
C -->|Yes| D
C -->|No| A Loading…
Extra dashes request a longer minimum layout span. Circle and cross ends can communicate different meanings, but Mermaid does not enforce those semantics. Invisible links influence layout without drawing an edge.
flowchart LR
A["Outline"] -->|Ready| B["Draft"]
B -.-> C["Review"]
C ==> D["Release"]
A ----> D
B o--o E["Checklist"]
E x--x D
C ~~~ E Loading…
Direction inside a subgraph works only where the global layout can respect it. When nodes connect outside their subgraph, Mermaid may inherit the parent direction. Use subgraph-to-subgraph edges when preserving local direction matters.
flowchart LR
subgraph prep ["Preparation"]
direction TB
A["Outline"] --> B["Draft"]
end
subgraph review ["Review"]
direction TB
C["Check"] --> D["Approve"]
end
prep --> review Loading…
ClassDef makes a reusable style. Apply it with class or :::; direct style targets one node. LinkStyle uses declaration order starting at zero, while a named edge can receive a class. Markdown labels provide emphasis without HTML labels.
flowchart LR
A["`**Guide** draft`"]:::focus e1@--> B["Review"]
B --> C["Publish"]
classDef focus fill:#d3e5ff,stroke:#0070f3,color:#171717
class B focus
style C stroke-width:2px
linkStyle 1 stroke:#0070f3,stroke-width:2px
classDef edge stroke:#0070f3
class e1 edge Loading…
Node and rank spacing tune the default layout. Large graphs may benefit from ELK, but a host must supply the optional renderer. Icon packs also need host registration; ordinary shapes work without either extension.
---
config:
flowchart:
nodeSpacing: 35
rankSpacing: 60
---
flowchart LR
A["Write"] --> B["Review"] --> C["Publish"] Loading…
Close the node brackets and quote the label.
Invalid syntax — corrected example below
flowchart LR
A[Draftflowchart LR
A["Draft"] --> B["Review"] Loading…
End closes a subgraph. Use a different stable id, then put the display word inside a quoted label.
The host controls security. This site deliberately disables diagram callbacks; the separate editor links remain usable.