Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>MD Mermaid Preview SupportNew to Visual Studio Code? Get it now.
MD Mermaid Preview Support

MD Mermaid Preview Support

Galvin Nguyen

|
18 installs
| (1) | Free
Adds Mermaid diagram and flowchart support to VS Code's built-in Markdown preview.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

MD Mermaid Preview Support

Adds Mermaid diagram rendering to VS Code's built-in Markdown Preview — offline, no setup required.

Features

  • 🧜 Renders Mermaid diagrams inside the native VS Code Markdown Preview panel
  • 🌗 Always renders in a clean light container (readable in any VS Code theme)
  • ⚡ Offline — Mermaid.js is bundled (no CDN calls)
  • 🔄 Live reload — diagrams re-render on file save
  • 🖱️ Interactive diagrams — pan, zoom, and resize each diagram independently

Usage

Write a Mermaid diagram using a fenced code block with the ```mermaid tag:

```mermaid
graph TD
    A[Start] --> B{Is it working?}
    B -->|Yes| C[🎉 Great!]
    B -->|No| D[Debug it]
    D --> A
```

Open the Markdown Preview (Ctrl+Shift+V) — the diagram renders automatically.

Diagram Interactions

Interaction Action
Pan Click & drag the diagram
Zoom Scroll wheel (zooms toward cursor)
Reset view Double-click, or press ⟳ in toolbar
Resize container Drag the bottom-right corner

Supported Diagram Types

All Mermaid diagram types are supported, including:

Type Syntax
Flowchart graph TD / flowchart LR
Sequence Diagram sequenceDiagram
Gantt Chart gantt
Pie Chart pie
Class Diagram classDiagram
State Diagram stateDiagram-v2
Entity Relationship erDiagram
Git Graph gitGraph
Mindmap mindmap
Timeline timeline

Installation

From VS Code Marketplace

Search for MD Mermaid Preview Support in the Extensions panel (Ctrl+Shift+X) and click Install.

From a .vsix file

code --install-extension md-mermaid-preview-support-1.1.0.vsix

Build from Source

git clone https://github.com/gndev-vn/md-preview-mermaid.git
cd md-preview-mermaid
npm install
npx vsce package
code --install-extension md-mermaid-preview-support-*.vsix

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft