Design

Styling and layout

The panel on the right of the editor, the inspector, changes how a diagram looks without touching its text. It has four tabs: Style, Layout, Nodes, and Fonts. Each diagram keeps its own style, saved with the diagram rather than in its code, and downloads and shared links use it. Hide or show the panel with Hide inspector and Show inspector at the right of the top bar. The settings apply most fully to flowcharts.

Style

Pick a theme, adjust its colours, and save the result to use again.

  1. Open the Style tab.
  2. Under Theme, click one of the 11 themes: Midnight, Monochrome, Glass, Cyberpunk Neon, Warm Editorial, Blueprint CAD, Forest Canopy, Ember Workshop, Print Ready, Slide Deck, Sage Notebook. For articles, slides, and blogs, try Print Ready (black on white, no shadows), Slide Deck (blue on white), or Sage Notebook (soft greens).
  3. Under Colors, click a swatch to change the canvas, the node fill (and its bottom colour, for gradients), the node border, the text, the edges, or the group titles.
  4. To keep the look, type a name under Your presets and choose Save. Click a saved preset’s name to apply it to the open diagram.

Good to know

  • A theme sets everything in the panel, including the layout engine, the look, and the font. If you’ve changed anything, it asks before replacing your changes.
  • Reset, at the foot of the panel, puts every setting back to the current theme’s defaults, after asking.
  • A preset keeps the style only. A saved template keeps the code too. Saving a preset with a name you already use replaces it.
  • Signed in, presets are saved to your account (the panel says In your account): 10 on Free, 200 on Pro and Pro Max; saving one more than your plan keeps asks you to upgrade. Signed out, they’re kept in this browser (On this device). On Pro and Pro Max, a deleted preset goes to the Bin for 14 days.
  • To give many diagrams one style at once, use Select and Apply style on the Projects page. To save the style as a file, or load one, use Theme JSON in Export.
  • Ctrl + Z undoes code, not style. To get an earlier style back, use Reset, a preset, or Version history, which restores a version’s code and style together.

Related guide: Diagrams for articles, slides and blogs: styles and exports that look right.

Try two themes, change the node border colour, and save the look as a preset.

Layout

Choose how the diagram is arranged: the engine that places the nodes, the direction they flow, how connections bend, and the space between them.

  • Layout engine: ELK layered (a clean hierarchy), ELK stress (a balanced, organic spread), ELK tree (a compact tree), ELK radial (rings around a hub), Grid (compact rows of boxes), or Dagre (Mermaid’s default). ELK and Grid apply to flowcharts; other diagram types use Mermaid’s own layout.
  • Direction: Auto (as the code says), left to right, top to bottom, right to left, or bottom to top. It works for flowcharts and for state, class, and ER diagrams, without changing your code. Stress, radial, and grid place nodes by their links, so they ignore the direction.
  • Curve, under Lines: smooth curves, S-curves, monotone, right angles, or straight lines.
  • Spacing: Between nodes (20 to 140 px) and Between ranks, the gap between one level and the next (30 to 160 px).

Diagrams arranged by hand

A diagram you’ve arranged in Manual mode keeps the positions you gave it, so the engine, direction, and spacing don’t move its nodes. The tab says Nodes are placed by hand; Arrange automatically forgets the positions and lays the diagram out with these settings. Choosing another engine or direction asks whether to do that too.

Related guide: Use a Mermaid visual editor without losing the source.

Change the layout engine, the direction, the line style, and the spacing.

Nodes

Fine-tune the shapes and the lines between them.

  • Shape: Corner radius (0 to 24 px) and Border width (1 to 4 px).
  • Look: Clean, or Hand-drawn for a sketched look.
  • Effects: Gradient fill shades nodes from the node fill at the top to the bottom colour set in the Style tab. Drop shadow adds depth, with its Blur, Offset, and Opacity.
  • Edges: Line thickness (1 to 4 px).
  • Animated flow: moving dashes along each connection. Cycle length sets how long one cycle takes (0.6 to 4 seconds; shorter is faster). The animation shows in the editor, in SVG files, and in animated exports (GIF, MP4, or WebM).
  • Label background: what sits behind the text on connections, so a line doesn’t run through it: Canvas (the canvas colour, the default), None, or Color, a colour of your own. It’s kept in downloads.
Round the corners, switch to the hand-drawn look, and animate the connections.

Fonts

Open the Fonts tab and click a font to use it for every label in the diagram. There are 12, grouped by kind:

  • Sans serif: Inter (neutral and highly legible), Plus Jakarta Sans (friendly, geometric), Space Grotesk (technical character), IBM Plex Sans (engineered, clear at small sizes), Source Sans 3 (compact, fits long labels), Nunito (rounded and soft).
  • Serif: Roboto Slab (slab serif, sturdy), Merriweather (classic, for articles), Lora (elegant, for blogs).
  • Monospaced: JetBrains Mono (monospaced, precise), Fira Code (monospaced, code-like).
  • Handwritten: Caveat (handwritten, for sketches).

All of them are served by Flowgraph Studio itself and kept in downloads and shared links, so the text looks the same everywhere. A theme sets its own font; pick another after choosing the theme.

Click a font in the Fonts tab: every label in the diagram changes.