Skip to content

Mermaid Diagram Inventory

Ready-to-use Mermaid diagrams — visual, copy-paste

A curated catalog of flowchart, sequence, class, state, ER, gantt, pie, mindmap, timeline, journey, git graph, and quadrant templates. Every card renders the diagram live — pick visually, copy the fenced ```mermaid block, paste into your Markdown. Works on GitHub, GitLab, Notion, Docusaurus, MkDocs, Obsidian, and any platform that speaks Markdown.

Inventory

Browse, filter, copy

Filter by name or category. Click Copy on any card to put the fenced ```mermaid block on your clipboard. Diagrams render automatically — no extra clicks.

31 of 31 templates
Rendering diagram…

Basic flow (LR)

Linear left-to-right flow with start, middle steps, and end.

Rendering diagram…

Decision tree

Branching workflow with a yes/no decision.

Rendering diagram…

Microservice request

Client → API gateway → service → database round trip.

Rendering diagram…

Login handshake

Browser, server, and database during a login flow.

Rendering diagram…

Typed API call

Sync and async messages between three actors.

Rendering diagram…

Class with inheritance

Animal base class with two subclasses.

Rendering diagram…

Composition

Order composes line items.

Rendering diagram…

Order state machine

Lifecycle of an order from creation to delivery.

Rendering diagram…

Auth session

Anonymous, authenticated, expired session states.

Rendering diagram…

Blog schema

Users, posts, and comments with relations.

Rendering diagram…

E-commerce core

Customers, orders, products, and line items.

Rendering diagram…

Two-week sprint

Design, build, QA, ship rhythm.

Rendering diagram…

Browser share

Quick distribution chart with four slices.

Rendering diagram…

Project brainstorm

Central topic with branches and sub-branches.

Rendering diagram…

Product roadmap

Quarterly roadmap with major milestones.

Rendering diagram…

User onboarding journey

Compact funnel with satisfaction scores.

Rendering diagram…

Feature branch flow

Trunk-based development with a feature branch merge.

Rendering diagram…

Priority matrix

Impact vs effort 2×2 with sample items.

Rendering diagram…

CI/CD pipeline

Commit → build → test → deploy with rollback branch.

Rendering diagram…

Retry with backoff

Request → retry loop → give up after N attempts.

Rendering diagram…

OAuth authorization code

Three-leg OAuth 2.0 with code exchange.

Rendering diagram…

Card payment flow

Checkout → tokenize → authorize → capture.

Rendering diagram…

Traffic light

Cyclic state machine: red → green → yellow → red.

Rendering diagram…

Media player

Play / pause / stop with buffer state.

Rendering diagram…

SaaS multi-tenant

Tenants, users, projects schema.

Rendering diagram…

Product launch plan

Beta, marketing, GA, and post-launch follow-up.

Rendering diagram…

Traffic sources

Where visitors come from.

Rendering diagram…

Engineering skills

Branches of a typical full-stack skill tree.

Rendering diagram…

Company milestones

Year-by-year highlights for a young company.

Rendering diagram…

Hotfix branch flow

Critical fix branched off main and back-merged.

Rendering diagram…

Eisenhower matrix

Urgent vs important task prioritization.

How Mermaid diagrams work in Markdown

Mermaid is a text-to-diagram language born at SAP and now maintained by an active open-source community. You write a diagram as plain text inside a Markdown code fence with the language tag mermaid — the renderer turns it into an SVG diagram at view time:

```mermaid
flowchart LR
  A[Start] --> B[Done]
```

Same source. Every platform. No image hosting, no asset pipeline, no broken links when you rename a section.

Why Mermaid won

Before Mermaid, technical writers had three choices: hand-draw a diagram in a UI tool and embed the exported PNG (impossible to diff, hard to keep in sync), use a heavy authoring app like Lucidchart or Draw.io (paid, requires manual sync), or skip the diagram entirely and describe the flow in prose. Mermaid removed all three trade-offs:

  • Plain text in version control. A line-level diff shows exactly what changed in a flowchart — same as code.
  • Renders inline on every Markdown platform. GitHub, GitLab, Notion, Docusaurus, Obsidian — pick a platform; if it speaks Markdown, it speaks Mermaid.
  • One source for docs and slides. The same diagram code can be embedded in a README, a Slidev deck, and a Jupyter notebook.
  • AI-friendly. Tell ChatGPT "give me a Mermaid sequence diagram for a login flow" and you get exactly what you need.

Where it renders

PlatformMermaid support
GitHub README / issues / PRsBuilt-in since 2022
GitLab MarkdownBuilt-in
Bitbucket CloudBuilt-in
NotionEmbed block
ObsidianBuilt-in
JoplinBuilt-in
Docusaurus@docusaurus/theme-mermaid
MkDocs Materialpymdownx.superfences
HugoMermaid shortcode
Astrorehype-mermaid
Markdown Viewer editor (this one)Live, in the preview pane

The 12 diagram types

TypeUse for
FlowchartProcesses, decisions, system architectures
SequenceAPI calls, message exchanges, login flows
ClassOO domain models, type hierarchies
StateFinite state machines, order lifecycles
ERDatabase schema, entity relations
GanttProject timelines, sprint planning
PieQuick percentage breakdowns
MindmapBrainstorms, taxonomies
TimelineRoadmaps, history
JourneyUser journey mapping with satisfaction scores
Git graphBranching workflows
QuadrantImpact-vs-effort and similar 2×2 matrices

Quick syntax pointers

  • Direction in flowcharts: LR (left to right), TD (top down), BT (bottom up), RL (right to left).
  • Node shapes: [Text] rectangle, (Text) rounded, {Text} rhombus (decision), ((Text)) circle, [(Text)] cylinder (database), [[Text]] subroutine, [/Text/] parallelogram (I/O).
  • Edge types: --> solid arrow, -.-> dashed, ==> thick, -- label --> labeled, --- open line.
  • Subgraphs: subgraph Titleend groups nodes inside a container.
  • Comments: %% comment (line is ignored by parser).
  • Init directives: %%{init: {'theme':'dark'}}%% at the top to set theme and other options.
  • Always validate. Use the Mermaid Validator before committing — invalid syntax silently fails to render on most platforms, leaving raw text in your README.

Workflow tips

  1. Start from a template. Browse the gallery below for a diagram type that matches your shape, then mutate labels and structure.
  2. Live-edit in our editor. The Markdown Editor preview pane re-renders Mermaid as you type. Way faster than the GitHub edit-commit-refresh loop.
  3. Validate before commit. A single typo in production Markdown means an unrendered diagram on your README — verify with the Mermaid Validator or our Diagram Inventory tool.
  4. Audit a docs repo. When migrating Markdown between platforms, the Code Block Extractor pulls every ```mermaid fence out of a document so you can verify each one renders on the new host.
  5. Pair with math. For technical content combining diagrams and equations, see the Math Equation Inventory for KaTeX/LaTeX templates.

Why use templates instead of writing from scratch?

A blank mermaid fence is intimidating. The syntax for sequence diagrams vs flowcharts vs ER diagrams is different — same library, different mini-languages. Templates give you:

  • A working starting point. Copy, mutate. No need to remember whether sequenceDiagram needs participant or actor.
  • Reference syntax in context. Want a decision node? Look at the flowchart-with-decision template.
  • Time savings. Most teams use only 4-5 diagram types regularly. The catalog covers every common case so you stop Googling "mermaid syntax cheat sheet" every other week.

Companion tools

Frequently asked questions

What is this Mermaid diagram inventory?
A curated library of 31 production-quality Mermaid diagram templates spanning every diagram type Mermaid supports — flowcharts, sequence, class, state, ER, gantt, pie, mindmap, timeline, journey, git graph, and quadrant. Each card auto-renders the live diagram so you can pick visually, then copy the `\`\`\`mermaid` block to your clipboard and paste into any Markdown document.
How do I use a template?
Click Copy on any card to put the fenced ```mermaid …``` block on your clipboard, then paste into your Markdown — README, GitHub issue, Notion embed, Docusaurus page, blog post. The triple-backtick code fence is included automatically; you don't need to add it.
Will GitHub actually render these diagrams?
Yes — GitHub natively renders any ```mermaid fenced code block in README files, issues, pull requests, discussions, and gists since 2022. The templates use standard Mermaid syntax that GitHub's bundled version supports. The same source works identically on GitLab, Bitbucket Cloud, and most modern Markdown renderers.
Which Markdown platforms support Mermaid?
Built-in: GitHub, GitLab, Bitbucket, GitBook, Notion (via embed block), Obsidian, Joplin, Discord (limited), Slack canvases. Plugin: Docusaurus (@docusaurus/theme-mermaid), MkDocs Material (pymdownx.superfences), Hugo (Mermaid shortcode), Jekyll (jekyll-mermaid), Astro (rehype-mermaid), and any unified-based pipeline using rehype-mermaid or remark-mermaid.
Can I edit a template after copying?
Of course — Mermaid is plain text. Change node labels, swap arrow directions (LR / TD / BT / RL), add or remove branches, restyle with classes, add subgraphs. The templates are scaffolds you mutate; the [Mermaid Validator](/tools/markdown-diagram-tools) confirms your edits still parse.
How do I customize colors and themes?
Inject `%%{init: {'theme':'forest'}}%%` at the top of any diagram to switch theme. Built-in themes: default, neutral, dark, forest, base. For per-node styling use `style nodeId fill:#f9f,stroke:#333,stroke-width:2px;` inside flowcharts, or `classDef name fill:#...;` then `class A,B name`.
What if my custom diagram has syntax errors?
Drop the source into the [Mermaid Validator](/tools/markdown-diagram-tools) — it parses with the same engine Mermaid uses and surfaces line-level errors. Common mistakes: stray colons in unquoted labels, smart quotes pasted from Word, missing direction declaration (`flowchart` needs `LR`/`TD`).
Why aren't the diagrams loading?
Mermaid is fetched on demand the first time the inventory loads, then cached. Initial paint can take a moment on slow connections. If a diagram doesn't appear, check the browser console — usually a CSP or content-blocker. The same library powers our editor preview, so anything that renders there will render here.
Is there a picker inside the editor too?
Yes. Open the [Markdown Editor](/editor) and click the diagram icon — the same templates appear in a modal as visual previews. Click to select, click Insert, the fence drops at your cursor. The modal works identically in our [integration iframe](/integrate-editor) so any site embedding our editor gets the picker too.
Can I contribute a new template?
Open an issue or pull request on our [GitHub repository](https://github.com/saifurrahmanshochib/markdown-viewer). Templates live in `lib/markdown-diagram-templates.ts` — one entry per diagram with title, description, category, and source. The inventory page and editor picker both pick it up automatically.

One copy. A diagram anywhere Markdown is rendered.

Free for any project — personal, commercial, internal. No signup, no API key, no attribution required.

Use the API

Ship Markdown features in your product with our REST API — render, convert, audit, and transform documents at scale.

New to the platform? Start with the API quickstart, then try a live request in the API playground.

Explore the API platform