Skip to content
Limited Time 40% off for early adopters — Get discount →

Mermaid Runtime

Last updated:

Mermaid Studio lets you customize how diagrams are rendered through runtime configuration overrides. You can set global defaults or configure different settings for preview, markdown, and export contexts.

Mermaid Studio bundles multiple Mermaid.js versions. You can choose which version to use for rendering in the Mermaid Runtime settings.

The version picker at the top of the Mermaid Runtime settings page. When no explicit selection is made, the default (latest) version is used.

When using diagram type not supported by the active Mermaid.js version, a banner will appear at the top of the editor indicating which version is required.

Version compatibility banner

Version-related syntax compatibility issues will mention the version mismatch in the error message.

The following Mermaid.js versions are currently bundled:

VersionNotes
11.13.0Latest (default)
11.12.3Previous stable version

Mermaid Studio supports four configuration contexts:

ContextDescription
BaseCommon configuration applied to all contexts
PreviewConfiguration for standalone .mmd file preview
MarkdownConfiguration for Mermaid diagrams in Markdown preview
ExportConfiguration for SVG/PNG export and printing

When rendering a diagram, configuration is shallow-merged in the following order:

Each layer overrides values from the previous layer. For example, if Base sets theme: dark and the Preview context sets theme: forest, previews will use the forest theme while other contexts use dark.

  1. Open Settings ( Command + Comma Control + Alt + S ) and navigate to Tools > Mermaid Studio > Mermaid Runtime.

    Mermaid Runtime Settings

  2. Click Edit… next to the context you want to configure.

  3. Edit the YAML configuration in the editor that opens.

    Config Editor with code completion

    The editor provides JSON schema-based validation and code completion for all available Mermaid configuration options. See the Mermaid configuration docs for the complete list of options.

  4. Save or close the file to apply changes.

To reset a context to defaults, click Reset next to that context.

Reset configuration

The table below lists common configuration keys. The editor provides code completion for all available options, and the full reference is in the Mermaid configuration docs.

KeyValuesDescription
themedefault, dark, forest, neutral, baseDiagram color theme
lookclassic, handDrawnRendering style
layoutdagre, elk, tidy-treeLayout algorithm (see Layout Plugins)
fontFamilyAny CSS font stackFont used in diagrams

You can also configure options for specific diagram types using nested keys like flowchart.curve or sequence.mirrorActors.

theme: neutral
look: handDrawn
theme: neutral
fontFamily: "fantasy"

Setting handDrawnSeed ensures consistent rendering across previews.

Nest options under the diagram type key to target a specific diagram:

flowchart:
curve: step

Mermaid Studio includes optional layout plugins that provide advanced layout algorithms. Enable them in the Mermaid Runtime settings, then reference them with layout: in your configuration or frontmatter.

ELK (Eclipse Layout Kernel) provides layered, force-directed, and tree layouts for flowcharts.

  1. Check ELK layout engine in the Mermaid Runtime settings
  2. Set layout: elk in your configuration or frontmatter

Tidy-tree provides optimized tree layout for hierarchical diagrams. Currently supported only in mindmap diagrams.

  1. Check Tidy-tree layout engine in the Mermaid Runtime settings
  2. Set layout: tidy-tree in your configuration or frontmatter

Layout plugins may increase preview loading time and memory usage.

You can also configure individual diagrams using YAML frontmatter, which takes precedence over runtime configuration overrides:

---
config:
flowchart:
curve: cardinal
---
flowchart LR
A[Start] --> B{Decision}
B -->|Yes| C[Action]
B -->|No| D[Skip]
C --> E[Done]
D --> E

The config editor supports YAML with schema-based validation and code completion:

Example configuration