Mermaid Lens is a Visual Studio Code extension that provides a zoomable Mermaid diagram viewer. It allows you to view, zoom, and export Mermaid diagrams as PNG/SVG to file/clipboard directly within your Markdown file.
Features
Interactive Diagram Viewer
Zoom in/out, drag, functionality
Mouse wheel zooming with center point preservation
1:1 scale and fit-to-screen options
Theme-aware rendering (matches VSCode theme)
Export Capabilities
Export diagrams as PNG
Export diagrams as SVG
Export diagram (PNG) to clipboard
The export Mermaid graph style is customizable that can be different the preview style
Installation
Open Visual Studio Code
Press Ctrl+Shift+X (Windows/Linux) or Cmd+Shift+X (Mac) to open the Extensions view