How to add a Mermaid diagram in Notion

Learn how to add a Mermaid diagram in Notion with a code block: pick the Mermaid option, write your diagram text, and expand it fullscreen.

Quick answer

To add a Mermaid diagram in Notion, type /code on an empty line of a page and choose Code - Mermaid from the menu. Notion adds a sample diagram. Replace the sample with your own Mermaid text and the diagram renders below it. Click the diagram to expand it.

Steps at a glance

  1. Open a page and click an empty line.
  2. Type /code to open the block menu.
  3. Choose Code - Mermaid from the menu.
  4. Replace the sample with your own Mermaid text.
  5. Click the rendered diagram to expand it.

Interactive demo

Loading demo…

Summary

Notion renders Mermaid text as a diagram inside a code block. You write a few lines of text and get a flowchart without a drawing tool, and the diagram updates as you edit the text.

Step-by-step guide

  1. Step 1

    Type the slash command

    Open the page you want to edit and click an empty line. Type /code to open the block menu, which lists matching blocks as you type.

  2. Step 2

    Choose the Mermaid code block

    In the menu, select Code - Mermaid. Notion inserts a code block with Mermaid as its language and shows a rendered sample diagram under the code.

  3. Step 3

    Replace the sample code

    Select the sample text in the code block and type your own Mermaid text, for example a short flow from Draft to Review to Publish. The diagram below the code redraws with your labels.

  4. Step 4

    Expand the diagram

    Click the rendered diagram to open it fullscreen. The nodes you wrote, Draft, Review and Publish, appear as connected boxes you can read at a larger size.

Why this matters

You are documenting a release process and a bulleted list hides the order of work. A Mermaid block turns a few lines of text into a flow you can edit in place, so the page stays accurate as the process changes.

Frequently asked questions

  • Does Notion show the diagram and the code together?

    Yes. The Mermaid code sits at the top of the block and the rendered diagram appears directly below it.

  • Can I see the diagram larger?

    Yes. Click the rendered diagram to expand it fullscreen.

Create interactive demos like this one — free, no coding required.

Start for free →