Skip to content

Block Diagram

Last updated:

Mermaid Studio provides full language support for Block diagrams inside IntelliJ-based IDEs, turning them into a first-class option for system architecture overviews, component diagrams, and high-level technical documentation. Block diagrams use a column-based layout to visualize system components and their relationships.

Syntax highlighting integrates directly with IntelliJ’s color scheme system, so diagram colors always match your editor theme.

Block diagram syntax highlighting in Armada Dark theme

The summary below shows the IDE support Mermaid Studio ships for block diagrams, grouped by capability.

IDE feature supportSelect a feature for its description.
Editing
Code Intelligence
Validation
Refactoring
Navigation & Docs
Preview
Visual Editing

Completions cover block types, arrow operators, CSS properties and values, class names, and node references. Quick fixes split edge chains, quote edge labels, and convert Markdown strings, and pressing Enter after a composite block header indents the next line automatically.

block
columns 3
A["API"]
B["Web"]
C["DB"]
%% Span multiple columns
D["Wide Block"]:2
space
  • columns N - Set the number of columns (or columns auto)
  • id:N - Make a block span N columns
  • space or space:N - Insert empty cells for spacing
SyntaxShape
id["Label"]Rectangle
id("Label")Rounded rectangle
id(("Label"))Circle
id((("Label")))Double circle
id{"Label"}Diamond
id{{"Label"}}Hexagon
id(["Label"])Stadium/pill
id[["Label"]]Subroutine
id[("Label")]Cylinder
id[/"Label"/]Lean right
id[\"Label"\]Lean left
id[/"Label"\]Trapezoid
id[\"Label"/]Inverted trapezoid
id>"Label"]Arrow rectangle
id<["Label"]>(right, down)Block arrow
SyntaxDescription
-->Arrow
---Line (no arrowhead)
--"label"-->Arrow with label
<-->Bidirectional arrow
-.->Dotted arrow
--oCircle endpoint
--xCross endpoint
--->Long arrow

Composite blocks group nested blocks together with their own layout:

block
columns 3
block:clients:3
columns 2
web["Web App"]
mobile["Mobile App"]
end
gateway["API Gateway"]:3
block:services:3
columns 3
auth["Auth"]
orders["Orders"]
billing["Billing"]
end
block:data:3
columns 3
cache[("Cache")]
db[("Database")]
queue[["Queue"]]
end
web --> gateway
mobile --> gateway
gateway --> auth
gateway --> orders
gateway --> billing
auth --> cache
orders --> db
billing --> queue
block
columns 2
A["Primary"]
B["Secondary"]
%% Define CSS classes
classDef primary fill:#4CAF50,color:#fff,stroke:#388E3C
classDef secondary fill:#2196F3,color:#fff
%% Apply classes
class A primary
class B secondary
%% Inline style
style A stroke-width:2px
  • classDef name properties - Define a reusable CSS class
  • classDef default properties - Set default styling for all blocks
  • class id1,id2 className - Apply a class to one or more blocks
  • style id properties - Apply inline CSS to a specific block

For complete syntax details, see the Mermaid Block Diagram documentation.