Diagrams / Mermaid Block Diagram: Syntax & Examples
Mermaid Block Diagram: Syntax & Examples
Learn Mermaid block diagram syntax with a grid-based example. Arrange components and spans, then distinguish grouping from process flow.
When to use Block Diagram
Build a Mermaid block diagram when grouping and relative placement are central to the explanation. Blocks work well for system layers, responsibilities, and a compact overview of related components. Define a small grid before adding text so the layout reinforces the information hierarchy.
Read the Block Diagram example
Diagram source
block-beta
columns 3
Editor["Pele Editor"]:3
Code["Code input"] Preview["Live preview"] Export["Export tools"]
PNG["PNG"] SVG["SVG"] PDF["PDF"]How to use this tool
- Start with the example in the editor and identify the elements that answer your question.
- Replace the sample labels and values, previewing after each structural change.
- Review the diagram at its intended reading size, then keep the source and export the format your document accepts.
Syntax and interpretation
| Concept | How to apply it |
|---|---|
| Grid | columns sets the grid width. A block can span several columns when it represents a larger grouping. |
| Labels | Keep the name of a component short and put detailed responsibilities in accompanying prose. |
| Connections | Add explicit connections if flow matters. Use a flowchart when decisions and directed paths are the main story. |
Common questions
When should I avoid a block diagram?
If the reader needs to follow an ordered process or a conversation over time, use a flowchart or sequence diagram. Spatial grouping alone does not explain sequence.