Adds Mermaid diagram and flowchart support to VS Code's builtin markdown preview
TypeScript
951
127 commits
updated Jun 30, 2026
[!WARNING] This extension is deprecated as it has been merged into VS Code 1.121.
Adds Mermaid diagram and flowchart support to VS Code's builtin Markdown preview and to Markdown cells in notebooks.

Currently supports Mermaid version 11.12.0.
Create diagrams in markdown using mermaid fenced code blocks:
```mermaid
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
```
You can also use ::: blocks:
::: mermaid
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
:::
Supports MDI and logos icons from Iconify:
```mermaid
architecture-beta
service user(mdi:account)
service lambda(logos:aws-lambda)
user:R --> L:lambda
```
Mermaid diagrams support panning and zooming to help explore large or complex diagrams. By default, navigation controls appear when you hover over or focus on a diagram. You can also navigate diagrams using the mouse:
To zoom in and out of diagrams:
+ and - buttons that appear in the navigation controlsTo reset the zoom level and position, click the reset button in the controls.
To pan around a diagram:
pan mode button in the navigation controls to enable click-and-drag panning without holding alt. Click it again to turn off pan mode.By default, click-and-drag panning requires holding the alt key to prevent accidental panning. Use markdown-mermaid.mouseNavigation.enabled to change this:
always — Click and drag always pans (no modifier key needed)alt — Click and drag only pans when holding alt (default)never — Disable mouse-based panning (controls and pinch-to-zoom still work)Diagrams can be resized vertically by dragging the bottom edge. This is most useful if you use the markdown-mermaid.maxHeight setting or use css to limit the diagram's natural size.
Use markdown-mermaid.resizable to disable this behavior, or markdown-mermaid.maxHeight to set a maximum height.
markdown-mermaid.lightModeThemeConfigures the Mermaid theme used when VS Code is using a light color theme. Supported values:
baseforestdarkdefaultneutralCurrently not supported in notebooks.
markdown-mermaid.darkModeThemeConfigures the Mermaid theme used when VS Code is using a dark color theme. Supported values:
baseforestdarkdefaultneutralCurrently not supported in notebooks.
markdown-mermaid.languagesConfigures language ids used to identify Mermaid code blocks in markdown. The default is ["mermaid"].
markdown-mermaid.mouseNavigation.enabledControls when mouse-based navigation (panning and zooming) is enabled. The default is alt. Supported values:
always — Always enable mouse navigation on mermaid diagramsalt — Only enable mouse navigation when holding down alt (option on Mac)never — Disable mouse navigationmarkdown-mermaid.controls.showWhen to show navigation control buttons. The default is onHoverOrFocus. Supported values:
never — Never show navigation controlsonHoverOrFocus — Show navigation controls when hovering over or focusing on a diagramalways — Always show navigation controlsmarkdown-mermaid.resizableAllow diagrams to be resized vertically by dragging the bottom edge. The default is true.
When enabled, you can drag the bottom edge of any diagram to adjust its height. The custom height is preserved as long as the diagram content doesn't change.
markdown-mermaid.maxHeightMaximum height for diagrams. Can be a number (pixels) or a CSS value like 80vh or 400px. Leave empty for no limit. The default is empty (no limit).
Examples:
400 — 400 pixels.80vh — 80% of the viewport (markdown-preview) height.markdown-mermaid.maxTextSizeMaximum allowed size of diagram text. The default is 50000.
You can use the built-in functionality to add custom CSS. More info can be found in the markdown.styles documentation
For example, add Font Awesome like this:
"markdown.styles": [
"https://use.fontawesome.com/releases/v5.7.1/css/all.css"
]
Use it like this:
```mermaid
graph LR
fa:fa-check-->fa:fa-coffee
```
194 followers · starred May 2026
95 followers · starred Jul 2026
1,922 followers · starred Jun 2022
51 followers · starred Feb 2026
Adds Mermaid diagram and flowchart support to VS Code's builtin markdown preview
TypeScript
951
127 commits
updated Jun 30, 2026
[!WARNING] This extension is deprecated as it has been merged into VS Code 1.121.
Adds Mermaid diagram and flowchart support to VS Code's builtin Markdown preview and to Markdown cells in notebooks.

Currently supports Mermaid version 11.12.0.
Create diagrams in markdown using mermaid fenced code blocks:
```mermaid
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
```
You can also use ::: blocks:
::: mermaid
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
:::
Supports MDI and logos icons from Iconify:
```mermaid
architecture-beta
service user(mdi:account)
service lambda(logos:aws-lambda)
user:R --> L:lambda
```
Mermaid diagrams support panning and zooming to help explore large or complex diagrams. By default, navigation controls appear when you hover over or focus on a diagram. You can also navigate diagrams using the mouse:
To zoom in and out of diagrams:
+ and - buttons that appear in the navigation controlsTo reset the zoom level and position, click the reset button in the controls.
To pan around a diagram:
pan mode button in the navigation controls to enable click-and-drag panning without holding alt. Click it again to turn off pan mode.By default, click-and-drag panning requires holding the alt key to prevent accidental panning. Use markdown-mermaid.mouseNavigation.enabled to change this:
always — Click and drag always pans (no modifier key needed)alt — Click and drag only pans when holding alt (default)never — Disable mouse-based panning (controls and pinch-to-zoom still work)Diagrams can be resized vertically by dragging the bottom edge. This is most useful if you use the markdown-mermaid.maxHeight setting or use css to limit the diagram's natural size.
Use markdown-mermaid.resizable to disable this behavior, or markdown-mermaid.maxHeight to set a maximum height.
markdown-mermaid.lightModeThemeConfigures the Mermaid theme used when VS Code is using a light color theme. Supported values:
baseforestdarkdefaultneutralCurrently not supported in notebooks.
markdown-mermaid.darkModeThemeConfigures the Mermaid theme used when VS Code is using a dark color theme. Supported values:
baseforestdarkdefaultneutralCurrently not supported in notebooks.
markdown-mermaid.languagesConfigures language ids used to identify Mermaid code blocks in markdown. The default is ["mermaid"].
markdown-mermaid.mouseNavigation.enabledControls when mouse-based navigation (panning and zooming) is enabled. The default is alt. Supported values:
always — Always enable mouse navigation on mermaid diagramsalt — Only enable mouse navigation when holding down alt (option on Mac)never — Disable mouse navigationmarkdown-mermaid.controls.showWhen to show navigation control buttons. The default is onHoverOrFocus. Supported values:
never — Never show navigation controlsonHoverOrFocus — Show navigation controls when hovering over or focusing on a diagramalways — Always show navigation controlsmarkdown-mermaid.resizableAllow diagrams to be resized vertically by dragging the bottom edge. The default is true.
When enabled, you can drag the bottom edge of any diagram to adjust its height. The custom height is preserved as long as the diagram content doesn't change.
markdown-mermaid.maxHeightMaximum height for diagrams. Can be a number (pixels) or a CSS value like 80vh or 400px. Leave empty for no limit. The default is empty (no limit).
Examples:
400 — 400 pixels.80vh — 80% of the viewport (markdown-preview) height.markdown-mermaid.maxTextSizeMaximum allowed size of diagram text. The default is 50000.
You can use the built-in functionality to add custom CSS. More info can be found in the markdown.styles documentation
For example, add Font Awesome like this:
"markdown.styles": [
"https://use.fontawesome.com/releases/v5.7.1/css/all.css"
]
Use it like this:
```mermaid
graph LR
fa:fa-check-->fa:fa-coffee
```
194 followers · starred May 2026
95 followers · starred Jul 2026
1,922 followers · starred Jun 2022
51 followers · starred Feb 2026