Skip to main content

Add a diagram to a Confluence page

Insert the Mermaid Diagram macro to draw a diagram on a Confluence page, blog post or live doc.

Before you begin​

  • Mermaid Diagrams Macro for Confluence is installed on your site.
  • You have permission to edit the page.
  • Your Mermaid Diagrams license is active. Viewing diagrams doesn't need one.

Insert the macro​

  1. Open the page and select Edit.

  2. Where the diagram should go, type /mermaid and select Mermaid Diagram. You can also select Insert (+) and search for Mermaid Diagram.

    The /mermaid command in the Confluence editor, offering the Mermaid Diagram macro

  3. In the macro, select Create diagram. The diagram editor opens.

    An empty Mermaid Diagram macro with the Create diagram button

  4. Start the diagram from a snippet, an import, Draft with AI, or your own code. See Edit a diagram.

  5. Select Save and close, then publish the page.

Result: The diagram shows on the page for everyone who can view it.

Change a diagram later​

You don't need to put the page in edit mode to change a diagram.

  1. Hover over the diagram and select Edit diagram (the pencil icon).
  2. Make your changes and select Save and close.

The diagram updates for readers straight away. Diagram changes are stored with the page's attachments, so they don't create a new page version.

What happens when you copy, move or delete a page​

When youWhat happens to the diagrams
Copy the pageThe copy gets its own copy of each diagram. Changing one doesn't change the other
Move the pageThey move with it
Export to PDF or WordEach macro shows its first diagram as an image, in light colors
Delete the pageThey go to the trash with it, and come back if you restore it
Restore an older page versionThey keep their latest content. Earlier versions stay in the page's attachment history
note

The macro doesn't work in space or page templates, because diagrams are stored with a page. In a template it shows "This diagram can't be loaded here". Add the macro after you create the page from the template.