Mermaid tutorials
Mermaid tutorials that stay on one job each: a diagram type, a tool integration, or a fix. Every example is checked against the Mermaid parser.
Start here
What is Mermaid?
What is Mermaid? A plain-language guide to diagrams as code, the diagram types, and where the text renders.
7 min read
How to create a Mermaid flowchart
How to create a Mermaid flowchart step by step: direction, shapes, arrows, subgraphs and the mistakes that break the parser.
8 min read
Fix a Mermaid syntax error
Fix a Mermaid syntax error: quotes, the word end, arrows, dates and the other mistakes behind 'Syntax error in text'.
9 min read
Mermaid themes
Mermaid themes, themeVariables, classDef and frontmatter. How to recolor a diagram without breaking dark mode.
7 min read
Diagram tutorials
Sequence diagram tutorial
A sequence diagram tutorial in Mermaid: participants, arrows, activations, alt and loop, built up on a checkout flow.
8 min read
UML class diagram example
A UML class diagram example in Mermaid, from an empty file to a blog model with inheritance and composition.
12 min read
How to make a Gantt chart in Mermaid
How to make a Gantt chart in Mermaid: dateFormat, sections, dependencies, milestones and weekends.
12 min read
State machine diagram example
A state machine diagram example in Mermaid: start, end, choices and a checkout lifecycle you can adapt.
12 min read
Mermaid GitGraph tutorial
A mermaid gitgraph tutorial covering commits, branches, checkout, merge and tags, with a GitFlow picture.
11 min read
How to make a mindmap
How to make a mindmap in Mermaid with indentation, shapes and a root node, plus the spacing mistakes to avoid.
11 min read
How to draw a C4 diagram
How to draw a C4 diagram in Mermaid: context, containers, people and relationships, with a SaaS example.
12 min read
SQL to Mermaid ER diagram
SQL to Mermaid: map CREATE TABLE keys and foreign keys into an erDiagram, then check the cardinality yourself.
6 min read
How to document software architecture
How to document software architecture with a small set of Mermaid diagrams that live next to the code.
13 min read
Convert draw.io to Mermaid
Convert draw.io to Mermaid: which drawings translate, which should stay images, and a workflow that does not invent layout.
12 min read
Integrations
Mermaid in Markdown
Mermaid in Markdown is a fenced code block tagged mermaid. How the fence works and which apps actually render it.
12 min read
Mermaid in GitHub
Use mermaid in GitHub READMEs, issues, pull requests and wikis. Fence syntax, dark mode, and the limits of GitHub's renderer.
6 min read
Mermaid in GitLab
Mermaid in GitLab Markdown, issues, merge requests and wikis. What renders, and how it differs from GitHub.
11 min read
Mermaid in Notion
Use mermaid in Notion with a code block set to Mermaid. Preview, split view, and what to do when the block stays blank.
11 min read
Mermaid in Obsidian
Mermaid in Obsidian renders from a mermaid fence. Reading view, live preview, themes, and the errors that break a note.
11 min read
Mermaid in VS Code
Mermaid in VS Code via the Markdown preview. Built-in support, the extension fallback, and where syntax errors show up.
11 min read
Mermaid in Confluence
Mermaid in Confluence needs an app or an embed. What Cloud supports, and when to export an image instead.
6 min read
Mermaid in Docusaurus
Turn on mermaid in Docusaurus with the official theme. Config, MDX fences, and light plus dark themes.
12 min read
Embed Mermaid in HTML
Embed Mermaid in HTML with the mermaid library or an iframe. A minimal page, securityLevel, and when to use an image.
12 min read
Export and AI
Export mermaid diagram to PNG, SVG or PDF
Export mermaid diagram files to PNG, SVG or PDF. PNG scale depends on the plan. JPG, SVG and PDF downloads are on Pro.
5 min read
Mermaid AI prompts
Mermaid AI prompts that produce a useful diagram: what to specify, examples by type, and how to revise a bad draft.
6 min read