Mermaid

No Change
adopt
First Added:July 23, 2023 Updated: July 7, 2026

Mermaid is a JavaScript library that renders Markdown-inspired text into flowcharts, sequence diagrams, ER diagrams, and more. We adopt it for git-backed docs, ADRs, research pages, and Hugo posts where diagrams should diff in PRs.

Blurb

JavaScript based diagramming and charting tool that renders Markdown-inspired text definitions to create and modify diagrams dynamically.

Summary

When to use:

UseNotes
Markdown and HugoFenced mermaid blocks render in many static sites and Git hosts
Architecture docsFlowcharts, sequence, class, C4-style, and ER views in repo text
Living researchgbrain pages and ADRs where the diagram evolves with prose
Quick reviewsMermaid Live Editor for paste-and-share drafts

When to skip:

  • Fine-grained layout, layers, or cloud icon libraries (Draw.io trial fits better)
  • Legacy DOT pipelines you already maintain (Graphviz hold)
  • One-off chat sketches that will never be committed (AsciiFlow hold)

Trade-offs: Syntax is learnable but strict. Typos break renders. Layout is automatic, so dense diagrams can get crowded. Prefer small, focused diagrams over kitchen-sink canvases.

Details

Diagram Types

DeclarationDiagram type
flowchart / graphFlowchart
sequenceDiagramSequence diagram
classDiagramClass diagram
erDiagramEntity relationship
stateDiagram-v2State diagram
ganttGantt chart
gitGraphGit graph
mindmapMindmap
timelineTimeline
quadrantChartQuadrant chart

Every diagram starts with a type declaration, then node and edge definitions. Line comments use %%.

Deployment

TopicNotes
npm / CDNmermaid package or jsDelivr for browser rendering
GitHubNative Mermaid in Markdown (README, issues, PR bodies)
HugoGoldmark or dedicated shortcode; this site’s garden pages support fenced blocks
ObsidianCore Mermaid plugin renders fenced blocks in preview

Syntax Tips

  • Wrap reserved words like end in quotes when they appear as node labels.
  • Avoid {} inside %% comments; the parser can confuse them with directives.
  • Test in Mermaid Live Editor before committing complex syntax.

Compared to Alternatives

ToolWhen Mermaid winsWhen the alternative wins
Draw.ioText diffs, docs-as-code, CI-rendered MarkdownManual layout, vendor icon stencils, stakeholder polish
GraphvizBroader diagram types, simpler author UX for common software diagramsExisting DOT tooling or graph algorithms you already depend on

See Diagramming for the full garden matrix.

References