merIDK / Diagram types / Block diagram
Mermaid block diagram: example and syntax
Block diagrams give you direct control over where each box goes. You set columns and spans yourself instead of leaving placement to the layout engine, which suits system overviews and hardware layouts.
Open this example in the editor
Example code
block-beta
columns 3
frontend["Frontend"] api["API"] db[("DB")]
space down<["sync"]>(down) space
cache["Cache"]:3
frontend --> api
api --> db
Result
block-beta
columns 3
frontend["Frontend"] api["API"] db[("DB")]
space down<["sync"]>(down) space
cache["Cache"]:3
frontend --> api
api --> dbSyntax quick reference
columns 3sets the grid width.id:2makes a block span two columns;spaceleaves a gap.- Arrow blocks:
id<["label"]>(down).
How to use it
- Open the example in the editor, or paste your own Mermaid code.
- Edit the code on the left. The preview updates as you type, and errors point to the line.
- Export SVG or PNG, copy a Markdown block for GitHub or Notion, or copy a share link.