Mermaid Diagram Themes
Preview Mermaid themes online before you use them in documentation, architecture diagrams, or presentations. Compare how the same Mermaid diagram looks with default, forest, dark, neutral, and base. Each example includes code you can edit and open in the full editor.
Compare Mermaid themes with your code
Edit the example or paste a diagram, then choose a theme. Open it in the full editor to share or export the result.
Live preview
Your code and selected theme travel with the link. PNG/SVG export and sharing are available in the full editor.
Default theme
A familiar palette for everyday documentation. Start here when you want a diagram with the standard Mermaid appearance.
---
config:
theme: default
---
flowchart TD
Draft[Draft] --> Review{Review}
Review -->|Approved| Publish[Publish]
Review -->|Changes| DraftForest theme
A green palette for nodes and decisions. Compare it with default when you want a different color scheme without changing your diagram.
---
config:
theme: forest
---
flowchart TD
Draft[Draft] --> Review{Review}
Review -->|Approved| Publish[Publish]
Review -->|Changes| DraftDark theme
A palette for dark backgrounds. Check the preview and export against a dark canvas so labels and connecting lines remain readable.
---
config:
theme: dark
---
flowchart TD
Draft[Draft] --> Review{Review}
Review -->|Approved| Publish[Publish]
Review -->|Changes| DraftNeutral theme
A restrained palette for black-and-white documents and print. Check the diagram at its intended size before adding it to a report.
---
config:
theme: neutral
---
flowchart TD
Draft[Draft] --> Review{Review}
Review -->|Approved| Publish[Publish]
Review -->|Changes| DraftBase theme
The starting point for custom colors. Add themeVariables to control node fills, text, borders, and connecting lines.
---
config:
theme: base
---
flowchart TD
Draft[Draft] --> Review{Review}
Review -->|Approved| Publish[Publish]
Review -->|Changes| DraftCustomize colors with themeVariables
Set theme: base, then add themeVariables inside the same frontmatter config block. Use quoted hex colors, such as "#fef3c7", so YAML reads the color as a value. Start with node fill, text, border, and line colors.
---
config:
theme: base
themeVariables:
primaryColor: "#fef3c7"
primaryTextColor: "#422006"
primaryBorderColor: "#d97706"
lineColor: "#92400e"
fontFamily: "Arial"
fontSize: "16px"
---
flowchart TD
Draft[Draft] --> Review{Review}
Review -->|Approved| Publish[Publish]
Review -->|Changes| Draft| Variable | Controls |
|---|---|
primaryColor | The fill of primary nodes. |
primaryTextColor | Text inside primary nodes. |
primaryBorderColor | The border of primary nodes. |
lineColor | Connecting lines and arrows. |
fontFamily | The diagram font family. |
fontSize | The diagram font size, such as 16px. |
Other diagram types can use additional variables. Check a real preview after each change. In this viewer, theme and layout controls retain your custom variables when you copy, share, or export the diagram.
Choose a theme for your diagram
Start with default for documentation, neutral for print, or dark for a dark canvas. Use forest to compare a green palette and base when you need custom colors. Check the labels and arrows at the size and background you will use in your document. Themes change appearance while the nodes and connections stay the same.
For a hand-drawn appearance, the full editor offers a separate Excalidraw rendering option. It is not one of Mermaid’s five built-in themes and uses a different rendering path.
See the official Mermaid theme documentation for additional variables, and the configuration reference for frontmatter options. Available variables can depend on the diagram type.