Skip to content
Lower pricing Individual licenses are now $49/year for Studio, $25 for Core — See pricing →

Flowchart

Last updated:

Mermaid Studio provides the most comprehensive flowchart support of any IntelliJ plugin, turning your IDE into a first-class editor for process flows, decision trees, and system workflows. Flowcharts are the most versatile diagram type in Mermaid.js, and every piece of IDE intelligence in Mermaid Studio — completions, refactoring, inspections, Code Vision, and the Style Pane — is tuned for them.

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

Flowchart syntax highlighting in Armada Dark theme

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

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

Rename refactoring and find usages cover node IDs, subgraph IDs, CSS class names, and edge IDs across the whole diagram. Go to Related jumps between a link and its linkStyle declaration in either direction.

Flowcharts support the full visual editing surface. The toolbar’s Edit Mode toggle (pencil icon) flips the preview between preview mode and visual editing; the sections below cover the flowchart-specific actions available once it’s on.

The Style Pane covers flowcharts as a first-class diagram type. Styleable elements include individual nodes, subgraph containers, links (edges, with linkStyle support), and classDef definitions.

The preset gallery lets you apply reusable styles to the selected element. Select a node or edge, then pick a preset from the gallery to apply its styles. Built-in presets cover common styling patterns; you can also save your own.

When a flowchart node is selected, the Style Pane shows a shape editor with:

  • Shape selector — choose from available node shapes with SVG icons showing each shape visually.
  • Arrow controls — configure the direction of connections into and out of the node.

Shape changes are written back to the diagram source as the appropriate Mermaid syntax.

When a link (edge) is selected, the Style Pane shows link-specific styling controls. Changes are written as linkStyle declarations in the diagram source. If a linkStyle declaration already exists for the selected link, the Style Pane updates it in place; otherwise a new declaration is added.

You can navigate between links and their linkStyle declarations using Go to Related ( Control + Command + Up Arrow Control + Alt + Up Arrow ).

When a node is selected, the Style Pane shows a Link tab for editing click-handler properties. This tab is only visible for nodes.

PropertyDescription
URLThe destination URL for the click handler
TooltipHover text shown over the node
TargetLink target (_self, _blank, _parent, or _top)

The Tooltip and Target fields are disabled until a URL is set. Setting a URL creates a click statement in the diagram source (for example, click A href "https://example.com" "My tooltip" _blank). If the node already has a click handler (including a JavaScript callback), it is replaced. Clearing the URL removes the click statement entirely.

Click Add Node in the toolbar to open the shape picker. The picker is organized into tabs (Basic, Process, Technical) showing the available node shapes with visual previews.

Shape picker with Basic, Process, and Technical tabs

Select a shape to insert a new node into the diagram source. The editor caret moves to the new node so you can immediately type its label.

Click Add Subgraph in the toolbar to insert a new subgraph container into the diagram source.

Drag the connection handle on a node to an empty area of the canvas. A shape picker appears at the drop location, lets you choose the shape, then inserts the new node connected to the source node by a new edge.

Hover over a node in edit mode to reveal a connection handle. Drag from the handle to a target node to create a new edge between them. The corresponding edge syntax is added to the diagram source automatically.

Drag an existing edge’s endpoint to a different node to change where the connection points. The source code is updated to reflect the new target.

A selected edge with link style properties in the Style Pane

Click and drag a selected node to reposition it. The source code is updated to reflect the new position.

  • Moving nodes between subgraphs — drag a node into or out of a subgraph to change its scope. When a node crosses a subgraph boundary, the source code structure is updated accordingly.
  • Moving subgraphs — click a subgraph to select it first, then drag. You can drag a subgraph into another subgraph to nest it.

With multiple elements selected, dragging moves all selected elements together as a batch.

Select one or more nodes and press Command + G Control + G to wrap them in a new subgraph. Grouping works with a single node, multiple nodes, or a mixed selection of nodes and subgraphs. When a selected subgraph already contains other selected elements, the nested elements are kept inside their parent automatically.

On Mermaid.js 11.17.0 or later, a subgraph can render collapsed to a single node, hiding its members until you need them. Select one or more subgraphs in edit mode and press Minus Sign Minus Sign to collapse them, or Plus Sign Plus Sign (also Equal Sign Equal Sign ) to expand them again; a multi-selection toggles as one undo step. Click the ellipsis row on a collapsed subgraph to expand it without selecting it first.

Each toggle writes an id@{ view: collapsed } statement after the subgraph’s end line, or removes it, so the collapsed state is part of the diagram source and renders the same anywhere. A subgraph that has only a title gets an id derived from that title first, since Mermaid.js otherwise addresses it by a position number that changes with every edit above it. In the editor, completion offers collapsed and expanded for the view key, and a statement placed before the subgraph’s end gets a warning with a quick-fix that moves it.

Collapsing in the preview is separate from code folding in the editor, which hides the subgraph’s lines without changing the diagram.

  • Alt + Shift + P Alt + Shift + P selects the parent subgraph of the current selection.
  • Alt + Shift + C Alt + Shift + C selects all children of the currently selected subgraph.
  • Alt + Shift + S Alt + Shift + S selects all siblings at the same nesting level as the current selection.

In flowcharts, inline label editing applies to node labels, subgraph titles, and edge labels. Double-click one, type the new text, and commit with Enter Enter .

Directions:

  • TD or TB - Top to bottom
  • LR - Left to right
  • RL - Right to left
  • BT - Bottom to top

Node shapes:

  • [Text] - Rectangle
  • ([Text]) - Stadium/pill
  • {Text} - Diamond (decision)
  • [/Text/] - Parallelogram (input/output)
  • ((Text)) - Circle

For more shapes, use the shape definition syntax (e.g., A@{ shape: datastore }). The full list of supported shapes is in the official Mermaid.js doucmentation.

Edges:

  • --> - Arrow
  • --- - Line
  • -.-> - Dotted arrow
  • ==> - Thick arrow
  • -->|Label| - Arrow with text
  • animate A --> B - Animated edge

Subgraphs:

flowchart LR
subgraph Backend
API --> DB
end
subgraph Frontend
UI --> API
end

A subgraph renders collapsed when a view statement follows its end line (Mermaid.js 11.17.0+):

flowchart LR
subgraph infra [Infrastructure]
LB --> App --> DB
end
infra@{ view: collapsed }

For the complete syntax reference, see the Mermaid.js Flowchart documentation.