Mermaid
Markdown-like syntax for creating flowcharts, diagrams, and visualizations programmatically.
3. Used by agents' projects
Dependency in 74 public GitHub projects set up for AI coding agents that we scanned (1.2%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
mermaid.ai/llms.txtFrom the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error
What Mermaid does
Mermaid turns a few lines of Markdown-like text into a diagram, so diagrams can live in the repo next to the code and be diffed and reviewed instead of redrawn; the README pitches this as a fix for documentation that goes stale.
Mermaid popularity
Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated
How Mermaid is used
- Mermaid is a dependency in 74 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (1.5% of the 4,867 JavaScript/TypeScript ones), #4 of 95 in charts and data visualisation.
- Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 196; those are left out of every share on this page.
- The most used alternative in our scan is Recharts (576 projects).
- Projects that use it most often also use remark-gfm (40.5%), jsdom (39.2%), React (68.9%).
By coding agent
Often used with
Mermaid in practice
Strengths
A Mermaid diagram is just text, so it goes through the same pull-request review as the code it describes. The README says diffs and reviews "just work".
The README says Mermaid code blocks render directly in Markdown on GitHub. A diagram in a README or docs file shows up as a picture with no extra tooling.
The README lists flowchart, sequence, class, state, ER, Gantt, pie, Git graph, mindmap, timeline and Sankey, and says there are more than 20 types in total.
Miro's product manager for its Mermaid feature writes that Mermaid "has taken on a new life" because LLMs are good at producing it. She also says agents can make targeted edits to a text diagram instead of regenerating it.
Watch out for
The docs warn that <code>end</code> in all lowercase as a node ID or label breaks the flowchart parser. Use <code>End</code>, <code>END</code> or another word.
A label like <code>-->|ok|</code> is read as a circle or cross edge. The docs say to add a leading space or capitalize it. Labels with commas, semicolons or parentheses also need quotes.
A recent minor release added <code>elk.orientFeedbackEdges</code>, enabled by default, which changes how some existing ELK diagrams are routed. To keep the old routing you have to set the option to <code>false</code>.
A flowchart from the README
flowchart LR
A[Hard] -->|Text| B(Round)
B --> C{Decision}
C -->|One| D[Result 1]
C -->|Two| E[Result 2]More about Mermaid
Funding
- GitHub Sponsors: https://github.com/knsv
- GitHub Sponsors: https://github.com/sidharthv96
- 3 GitHub sponsors
Agent Skills for it
- mermaid-diagram: Generate Mermaid diagrams from user requirements. Supports flowcharts, sequence diagrams, class diagrams, ER diagrams, Gantt charts, and 18
- mermaid-to-proverif: Translates Mermaid sequenceDiagrams describing cryptographic protocols into ProVerif formal verification models (.pv files). Use when genera
- mermaid-studio: Expert Mermaid diagram creation, validation, and rendering with dual-engine output (SVG/PNG/ASCII). Supports all 20+ diagram types including
- mermaid-visualizer: Transform text content into professional Mermaid diagrams for presentations and documentation. Use when users ask to visualize concepts, cre
- mermaid-visualizer: Transform text content into professional Mermaid diagrams for presentations and documentation. Use when users ask to visualize concepts, cre
- mermaid-syntax: Mermaid syntax reference for writing or fixing a diagram in an artefact: flowchart, sequence, class, state, ER, Gantt, C4, mindmap, timeline
Packages around it
- react: UI library
- remark-gfm: GitHub-flavored Markdown for remark
- clsx: className string helper
- typescript: Typed JavaScript
- tailwindcss: Utility-first CSS
- class-variance-authority: Component style variants
More in Charts and data visualisation
Alternatives
Mermaid This page
Composable React component library for building responsive charts.
JavaScript library for creating data-driven documents with powerful data visualization capabilities.
Get started
Install it.
npm install mermaidRules for your agent
## Mermaid
- Start every diagram with its type declaration, for example `flowchart LR` or `sequenceDiagram`.
- Never use lowercase `end` as a flowchart node ID or label; write `End` or `END`.
- If an edge label starts with `o` or `x`, add a leading space or capitalize it (`-->| ok|` or `-->|Ok|`) so it is not read as a circle or cross edge.
- Wrap node labels that contain parentheses, commas or semicolons in quotes: `A["This label has (parentheses)"]`.
- Define a node's label once and reference it by ID everywhere else.
- When upgrading, check the release notes for layout changes: with ELK, set `elk.orientFeedbackEdges: false` to keep the previous routing.