Mermaid Diagrams

Render Mermaid diagrams from text in NocoDocs.

NocoDocs renders Mermaid diagrams directly inside code blocks. Write the diagram as text and NocoDocs draws the SVG — flowcharts, sequence diagrams, class diagrams, state diagrams, ER diagrams, Gantt charts, pie charts, user journeys, and more.

Flowchart example rendered in NocoDocs

Insert a Mermaid Diagram

  1. Insert a code block (type /code or ```).
  2. Click the language selector in the top-right of the code block and choose Mermaid.
  3. Type or paste your Mermaid source. The diagram renders as you type.

Selecting Mermaid from the code block language list

View Modes

Once the block's language is set to Mermaid, a view-mode picker appears in the toolbar. Open it to switch between the three modes:

View-mode picker with Show code, Split view, and Show diagram options

Show code

Source only. Useful while editing.

Mermaid block in Show code mode

Split view

Source on top, rendered diagram below. Lets you edit and preview in the same block.

Mermaid block in Split view mode with code above and diagram below

Show diagram

Diagram only. Cleanest reading view.

Mermaid block in Show diagram mode

The current mode is saved on the block itself — every reader sees the same view the author last selected. New blocks default to Show code while editing and Show diagram for read-only viewers.

Expand & Download

When the diagram is visible, two extra actions appear in the toolbar:

  • Expand diagram — opens the diagram in a full-screen modal. You can also click the diagram itself to expand.
  • Download image — downloads the rendered diagram as an .svg file.

Expand and Download buttons in the Mermaid block toolbar

Diagram opened in the full-screen modal

Theme

Diagrams use a NocoDB-aligned palette and automatically switch between light and dark variants to match the editor theme.

Errors

If the Mermaid source is invalid, an inline error message appears in place of the diagram with the parser's reason. The source is preserved — switch back to Show code to fix it.

Inline error message shown when Mermaid syntax is invalid

Supported Diagram Types

NocoDocs supports every diagram type Mermaid offers. The most common are shown below.

Flowchart

Visualise processes, decisions, and branching logic.

Flowchart

Sequence Diagram

Show interactions between participants over time.

Sequence diagram

Class Diagram

Model object-oriented structures, attributes, and relationships.

Class diagram

State Diagram

Capture state transitions and finite-state machines.

State diagram

Entity Relationship Diagram

Describe database schemas and table relationships.

ER diagram

Gantt Chart

Plan project timelines, dependencies, and milestones.

Gantt chart

Pie Chart

Show proportional breakdowns of a whole.

Pie chart

User Journey

Map user steps and satisfaction across a workflow.

User journey

Git Graph

Illustrate branches, commits, and merges.

Git graph

Mind Map

Organise hierarchical ideas around a central topic.

Mind map

Timeline

Track events along a chronological axis.

Timeline

Sankey Diagram

Show flows and proportions between categories.

Sankey diagram

XY Chart

Plot data series on cartesian axes (line, bar).

XY chart

C4 Diagram

Document software architecture at varying levels of detail.

C4 diagram

Exports

Mermaid diagrams are preserved when you export the document:

  • HTML and PDF exports embed the rendered SVG diagram inline.
  • Markdown exports keep the source as a ```mermaid fenced code block, which GitHub, Obsidian, and other Mermaid-aware viewers render automatically.
Refer to the Mermaid documentation for the full syntax reference and the diagram types supported.