Off layout

No toolbar and no buttons. Click or tap a diagram to open the fullscreen viewer. On the page it looks exactly like the plain SVG.

The Mermaid diagrams on this page use Mermaid 12.1.0 with the base theme and the demo's own colours. The demo CSS also colours the nodes, lines and arrowheads so the diagrams match the light and dark page themes.

Live diagrams

Company structure

Chart
CEO John Executive CTO CFO

Click or tap the diagram to open it fullscreen.

Performance stress test

2,500 nodes

Click or tap to open the 2,500 node grid.

Complex workflow

Mermaid
graph TD A[Start] --> B[Process A] B --> C{Success?} C -->|Yes| D[Finalize] C -->|No| E[Retry] E --> B D --> F[Send Email] F --> G[End]

Mermaid 12.1.0 with its default ELK layout and neo look.

Show that it opens

A phone has no cursor, so nothing says that a tap opens the diagram. Set offHint, or data-diagview-off-hint on one diagram, to add a small hint.

Icon

icon
graph LR A[Write] --> B[Review] --> C[Ship]

data-diagview-off-hint="icon". A badge in the corner. A mouse shows it on hover or Tab, a phone always. Mermaid 12.1.0 with its default ELK layout and neo look.

Label

label
graph LR A[Write] --> B[Review] --> C[Ship]

data-diagview-off-hint="label". The badge with "Click to expand", or "Tap to expand" on a phone. Mermaid 12.1.0 with its default ELK layout and neo look.

Below

below
graph LR A[Write] --> B[Review] --> C[Ship]

data-diagview-off-hint="below". A line under the diagram, on phones only. A mouse has the zoom-in cursor. Mermaid 12.1.0 with its default ELK layout and neo look.

Why choose this layout?

Pick it when the page should show only the diagram.

No extra elements

Off mode adds no wrapper elements, no toolbar, no buttons. DiagView only adds a click and a key handler, a tab stop, a screen reader name, a class and a few data attributes. With offHint set it also adds the hint element. For icon and label it adds the diagview-off-host class too, unless the diagram is the svg itself. destroy() removes them all.

A zoom-in cursor

The cursor turns into the zoom-in magnifier a card shows in the other layouts, so readers find the fullscreen viewer on their own, and the diagram still looks embedded rather than decorated. Tab stops on the diagram, and Enter or Space opens it.

Good for embeds and iframes

Use it in blog posts, documentation pages, or iframes where toolbar chrome would look out of place. Clean SVG, full viewer on demand.

Keyboard reference

A click or tap opens the viewer. Once it is open, these keys work and Tab reaches every button.

Zoom

+
Zoom in
-
Zoom out
Space / 0
Reset & center

Pan

↑ ↓ ← →
Pan
Shift + ↑ ↓ ← →
Fast pan
Drag
Free pan

Search

F
Open search
Esc
Clear / close
Enter
Next match
Shift + Enter
Previous match

Tools

M
Meeting mode
R
Rotate 90°
L
Share link
T
Text select
?
Show shortcuts

Integration

Turn the controls off for every diagram, or for one at a time.

app.js
// Off mode. A click opens it.
DiagView.init({
  diagramSelector: '.diagram',
  layout:          'off',
  offHint:         'icon'  // a badge that shows it opens
});

<!-- Mix layouts -->
<div
  class="diagram"
  data-diagview-layout="off"
>
  <!-- no toolbar -->
  <svg>...</svg>
</div>

<div
  class="diagram"
  data-diagview-layout="floating"
>
  <!-- buttons on hover -->
  <svg>...</svg>
</div>