Skip to content

Preview

Last updated:

Mermaid Studio’s diagram preview pane provides interactive pan and zoom controls along with customizable appearance settings. Access preview settings at Settings > Tools > Mermaid Studio > Preview.

Preview settings

Diagram colors come from the runtime appearance defaults, which pick adaptive light and dark themes, a look, and a font that apply across the live preview, Markdown preview, export, and print. The settings below tune how the preview pane itself displays those diagrams.

Set the background color of the preview pane: Match Editor, Auto, Black, or White. Auto picks white or black based on the diagram’s resolved theme. Every editor follows this setting; there is no per-editor override.

The setting also decides which variant a standalone diagram without an explicit theme renders. With Auto or Match Editor, the light or dark variant follows your IDE theme. With White or Black, the forced canvas decides, so a dark IDE with a White background renders the light variant. The Appearance menu, the Switch Diagram Theme popup, and Match preview export, print, and copy all use that same variant. Markdown previews ignore this setting and follow the IDE theme; see Light and dark rendering.

Some dark IDE themes have very dark gray or black backgrounds that can make certain diagram elements or edges difficult to see.

Dark background

Enable Lighten Dark Backgrounds to lighten the preview background by 10%, improving diagram visibility.

Lighten dark backgrounds option

As seen below, enabling this option changes the preview background from very dark to a lighter shade, making black elements more visible:

Lightened background

The preview shows two toolbars over the diagram: the zoom controls, and in edit mode the diagram actions toolbar. The Toolbar Layout group places each one where it suits your layout.

SettingDescription
ZoomPosition of the zoom controls (default Bottom Right)
Diagram actionsPosition of the diagram actions toolbar (default Top Right)
Corner orientationVertical (default) or Horizontal for a toolbar placed in a corner

Each position is a corner (Top Left, Top Right, Bottom Left, Bottom Right) or the middle of an edge (Top Center, Middle Left, Middle Right, Bottom Center). A toolbar at the middle of the top or bottom edge always runs horizontally, and one at the middle of a side always runs vertically. Give both toolbars the same position and they line up as one group, with the diagram actions first.

Navigate to Declaration lets you jump from a rendered element in the preview to its definition in the source code.

In preview mode (edit mode off), hold Command Control and click an element. In edit mode, a plain click navigates directly.

SettingDescription
Navigation from previewClick elements to jump to their source definition
Highlight on hoverShow visual feedback when hovering over navigable elements

For the full interactive editing experience including selection, drag-to-connect, and inline editing, see Visual Editing.

The preview pane (along with export, print, copy, Markdown rendering, and Diagram Sync) stays disabled in untrusted projects. Once you mark the project trusted, the preview re-activates automatically with no IDE restart required and no preview-specific setting to flip. See Security for the full behavior and for the related Mermaid.js securityLevel config that controls what diagrams can do at render time.