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

Classic shapes (bracket syntax) Edit and export
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)))
Newer shapes (@{ shape } syntax) Edit and export
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.

SyntaxShapeFlowchart meaning
id[text]RectangleProcess step
id(text)Rounded rectangleAlternate process, event
id([text])Stadium (pill)Terminal: start or end
id[[text]]Rectangle with side barsPredefined process (subroutine)
id[(text)]CylinderDatabase
id((text))CircleOn-page connector
id(((text)))Double circleStop, end state
id>text]Flag (asymmetric)Signal, tag
id{text}DiamondDecision
id{{text}}HexagonPreparation
id[/text/]ParallelogramInput or output
id[\text\]Parallelogram, other slantInput or output (variant)
id[/text\]TrapezoidPriority action
id[\text/]Inverted trapezoidManual 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.

Same node, two syntaxes
flowchart LR
  a[(Orders)] --> b@{ shape: cyl, label: "Orders" }
Shape names checked against the Mermaid version Arrowly ships. An unknown name gives the error “No such shape”.
Flowchart symbolShape nameClassic equivalent
Processrect[text]
Eventrounded(text)
Terminal (start/end)stadium([text])
Subprocessfr-rect[[text]]
Databasecyl[(text)]
Decisiondiam{text}
Preparationhex{{text}}
Input / outputlean-r / lean-l[/text/] / [\text\]
Manual operationtrap-t[\text/]
Priority actiontrap-b[/text\]
Documentdocnone
Multiple documentsdocsnone
Delaydelaynone
Manual inputsl-rectnone
Displaycurv-trapnone
Loop limitnotch-pentnone
Disk storagelin-cylnone
Direct access storageh-cylnone
Internal storagewin-panenone
Stored databow-rectnone
Collatehourglassnone
Extracttrinone
Manual fileflip-trinone
Summarycross-circnone
Junctionf-circnone
Start / stop (small circles)sm-circ / fr-circnone
Commentbracenone
Cardnotch-rectnone
Text onlytextnone

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 notes

Questions

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.