All diagram types Open editor

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 --> db

Syntax quick reference

How to use it

  1. Open the example in the editor, or paste your own Mermaid code.
  2. Edit the code on the left. The preview updates as you type, and errors point to the line.
  3. Export SVG or PNG, copy a Markdown block for GitHub or Notion, or copy a share link.

More diagram types