Mermaid reference
Mermaid flowchart shapes
Mermaid has two ways to set a node's shape: bracket pairs like {…} for the classic shapes, and the newer @{ shape: … } syntax, which adds the standard flowchart symbols (document, delay, manual input and more). Both are drawn below with the Mermaid version Arrowly uses.
Updated
flowchart LR
a[Rectangle] --> b(Rounded) --> c([Stadium])
d[[Subroutine]] --> e[(Database)] --> f((Circle))
g>Flag] --> h{Decision} --> i{{Hexagon}}
j[/Input or output/] --> k[\Reverse slant\]
l[/Trapezoid\] --> m[\Inverted trapezoid/] --> n(((Double circle)))flowchart LR
A@{ shape: doc, label: "Invoice" } --> B@{ shape: diam, label: "Valid?" }
B --> C@{ shape: cyl, label: "Ledger" }
B --> D@{ shape: delay, label: "Wait 3 days" }
D --> E@{ shape: sl-rect, label: "Manual check" }Classic shapes
These work in every Mermaid version you're likely to meet, including older ones embedded in wikis and plugins.
| Syntax | Shape | Flowchart meaning |
|---|---|---|
id[text] | Rectangle | Process step |
id(text) | Rounded rectangle | Alternate process, event |
id([text]) | Stadium (pill) | Terminal: start or end |
id[[text]] | Rectangle with side bars | Predefined process (subroutine) |
id[(text)] | Cylinder | Database |
id((text)) | Circle | On-page connector |
id(((text))) | Double circle | Stop, end state |
id>text] | Flag (asymmetric) | Signal, tag |
id{text} | Diamond | Decision |
id{{text}} | Hexagon | Preparation |
id[/text/] | Parallelogram | Input or output |
id[\text\] | Parallelogram, other slant | Input or output (variant) |
id[/text\] | Trapezoid | Priority action |
id[\text/] | Inverted trapezoid | Manual operation |
The @{ shape } syntax
Write the node id, then @{ shape: name, label: "text" }. The label is always quoted, which also removes the usual escaping problems. Mermaid added this syntax in version 11.3; older renderers show an error instead of the diagram.
flowchart LR
a[(Orders)] --> b@{ shape: cyl, label: "Orders" }| Flowchart symbol | Shape name | Classic equivalent |
|---|---|---|
| Process | rect | [text] |
| Event | rounded | (text) |
| Terminal (start/end) | stadium | ([text]) |
| Subprocess | fr-rect | [[text]] |
| Database | cyl | [(text)] |
| Decision | diam | {text} |
| Preparation | hex | {{text}} |
| Input / output | lean-r / lean-l | [/text/] / [\text\] |
| Manual operation | trap-t | [\text/] |
| Priority action | trap-b | [/text\] |
| Document | doc | none |
| Multiple documents | docs | none |
| Delay | delay | none |
| Manual input | sl-rect | none |
| Display | curv-trap | none |
| Loop limit | notch-pent | none |
| Disk storage | lin-cyl | none |
| Direct access storage | h-cyl | none |
| Internal storage | win-pane | none |
| Stored data | bow-rect | none |
| Collate | hourglass | none |
| Extract | tri | none |
| Manual file | flip-tri | none |
| Summary | cross-circ | none |
| Junction | f-circ | none |
| Start / stop (small circles) | sm-circ / fr-circ | none |
| Comment | brace | none |
| Card | notch-rect | none |
| Text only | text | none |
Choosing shapes that people understand
- Most readers know four shapes: rectangle (step), diamond (decision), pill (start/end) and cylinder (data). A diagram that sticks to them needs no legend.
- Decisions read best as a question with labelled exits:
B{Paid?}then-->|Yes|and-->|No|. - Use the specialised symbols (delay, manual input, document) only when your readers use them too, typically in process-improvement or audit documents.
- Keep labels short: two to five words. Details go in a note or in the document around the diagram.
Arrowly's AI picks among five of these shapes (step, decision, start/end, data, input/output) when it turns your notes into a flowchart, and writes the classic syntax so the code works in older renderers too.
Describe it in words instead
Paste notes about a process, a team or an exchange between systems. Arrowly draws the flowchart, org chart or sequence diagram and gives you Mermaid code that always parses. 3 free diagrams a day, no signup.
Draw from my notesQuestions
Why does my @{ shape } diagram fail on another site?
That site runs a Mermaid version older than 11.3, which doesn't know the syntax. Use the classic bracket equivalent from the table, or export the diagram as an image.
Can I change the size of one shape?
Not directly: shapes grow with their label. Longer or shorter labels, or a line break with <br/> inside a quoted label, are the practical levers.