Search...Search plugins and themes...
⌘K
Sign in
  • Get started
  • Download
  • Pricing
  • Enterprise
  • Account
  • Obsidian
  • Overview
  • Sync
  • Publish
  • Canvas
  • Mobile
  • Web Clipper
  • CLI
  • Learn
  • Help
  • Developers
  • Changelog
  • About
  • Roadmap
  • Blog
  • Resources
  • System status
  • License overview
  • Terms of service
  • Privacy policy
  • Security
  • Community
  • Plugins
  • Themes
  • Discord
  • Forum / 中文论坛
  • Merch store
  • Brand guidelines
Follow us
DiscordTwitterBlueskyThreadsMastodonYouTubeGitHub
© 2026 Obsidian

Best Mermaid

leo6leo62 downloads

Take over mermaid rendering in reading view with theme-aware styling, style packs, pan & zoom, PNG export, and readable error messages.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates2

English | 简体中文

Diagrams that feel like they belong in your notes.

Your notes have a theme. Your diagrams don't — the same purple boxes, mismatched fonts, and edges that cross like spaghetti. Best Mermaid re-renders every mermaid diagram in your vault with your theme's own colors, curated styles, and professional layout. No configuration. No new syntax.

Install it, open a note, and it just looks right.

  • ✦ Zero config — your existing diagrams look better the moment the plugin loads
  • ✦ Follows your theme — light/dark, custom CSS, accent colors: diagrams dress accordingly
  • ✦ Style packs — one line switches a diagram to a print-ready or presentation look
  • ✦ Stays offline — mermaid and elk are bundled; nothing leaves your vault

Before vs after Best Mermaid

Left: the default Obsidian mermaid renderer. Right: Best Mermaid with the Paper style — theme-matched grayscale palette and clean orthogonal routing.

Zoomed diagram with pan and zoom

Ctrl + scroll zooms at the cursor (trackpad pinch works too); drag to pan; double-click to reset — zoom stays put across re-renders.

PNG export dialog

Click the download icon at the bottom-right of any diagram: edit the file name, pick 1x–4x quality, and save anywhere through the native save dialog.

Style gallery in settings

The style gallery: four built-in style packs with live swatches. Pick a default here; override any single diagram with %% bm-style: <id> %%.

Why another mermaid plugin?

There are several mermaid appearance plugins already. Best Mermaid differs in a few ways:

  • Style packs, not just color tweaks. Each style is a complete, self-describing card: palette, typography, line style, spacing, and even the layout engine. Switching a style re-lays out the diagram.
  • Theme fusion. Diagram colors are resolved from your theme's CSS variables through a probe element, so diagrams follow your light/dark theme (and custom theme CSS) instead of mermaid's fixed palettes.
  • Style choice travels with the diagram. A per-diagram directive in the code block keeps your style choice when you copy the block or sync the note.
  • Engine and style are linked. The print-oriented style automatically uses the elk layout engine for orthogonal routing; other styles use dagre. You can also pin the engine in settings.

Features

  • Take over rendering of ```mermaid blocks in reading view, replacing the built-in renderer
  • Style packs with a gallery in settings — 4 built-in styles:
    • Follow theme — colors resolved from Obsidian CSS variables, follows light/dark
    • Midnight — slate night + indigo accent for screenshots and presentations
    • Paper — black & white orthogonal routing (elk), print/export friendly
    • Terra — warm, humanist palette for teaching and sharing
  • Per-diagram style override that lives in the diagram source
  • %%{init}%% directives respected — in-diagram directives merge over plugin settings (user intent always wins); themeCSS appends instead of replacing
  • Layout engine: dagre (default) or elk with orthogonal edge routing, switched per style, per diagram, or globally
  • Pan & zoom: Ctrl + scroll to zoom at the cursor (trackpad pinch works), drag to pan, double-click to reset; zoom state survives re-renders
  • Horizontal alignment of rendered diagrams (left / center / right)
  • Readable errors: syntax problems render as a visible error box with the offending line, never a silent blank
  • Render cache + serial render queue: concurrent diagrams can't clobber each other's config; identical diagrams render once
  • Fully offline — mermaid and elk are bundled, no network requests, no telemetry

Usage

Write mermaid blocks as usual:

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

Pin a style to a diagram (the directive is a comment — Obsidian without this plugin ignores it safely):

```mermaid
%% bm-style: midnight %%
flowchart LR
    A --> B
```

In-diagram customization still works and takes priority over the plugin:

```mermaid
%%{init: {'themeVariables': {'primaryColor': '#ffd54f'}}}%%
flowchart TB
    A[Custom gold] --> B
```

Built-in style ids

id name notes
follow Follow theme dynamic, resolves theme CSS variables
midnight Midnight static, dark presentation look
paper Paper static, orthogonal routing via elk
terra Terra static, warm humanist palette

Interactions (reading view)

Action Effect
Ctrl + scroll / trackpad pinch zoom anchored at cursor (0.2×–8×)
Drag (when zoomed) pan
Double-click reset to 100%
Zoom out below 100% and pause snaps back to fit

Limitations

  • Live Preview (editing view) still uses Obsidian's built-in mermaid renderer; this plugin takes over the reading view
  • Desktop only for now (isDesktopOnly: true); the bundle includes mermaid + elk (~12 MB)

Development

npm install
npm run dev     # esbuild watch
npm test        # vitest + jsdom, real mermaid render pipeline tests
npm run build   # type-check + production bundle

Manual install for testing: copy main.js, manifest.json, styles.css into <vault>/.obsidian/plugins/best-mermaid/.

License

MIT

HealthExcellent
ReviewSatisfactory
About
Render mermaid diagrams to match your vault theme's colors, typography, and spacing while applying curated style packs and professional layouts. Work with zero config, keep styles per-diagram, run fully offline with bundled engines, and use interactive pan/zoom plus export at selectable resolutions.
VisualizationAppearance
Details
Current version
1.0.1
Last updated
8 hours ago
Created
21 hours ago
Updates
2 releases
Downloads
2
Compatible with
Obsidian 1.13.0+
Platforms
Desktop only
License
MIT
Report bugRequest featureReport plugin
Author
leo6leo6
GitHubplay2003
  1. Community
  2. Plugins
  3. Visualization
  4. Best Mermaid

Related plugins

Galaxy View

Cinematic 3D graph view of your vault — fly through your notes like NASA Eyes.

Excalidraw

Visual PKM powerhouse. Create and edit Excalidraw drawings.

Advanced Canvas

Supercharge your canvas experience. Create presentations, flowcharts and more.

Minimal Theme Settings

Control the colors and fonts in Minimal Theme.

ExcaliBrain

An interactive, structured mind-map of your Obsidian vault.

Hider

Hide interface elements such as tooltips, status bar, titlebar, and more.

Breadcrumbs

Visualise the hierarchy of your vault using a breadcrumb trail or matrix view.

Mermaid Tools

Improved Mermaid.js experience: visual toolbar with common elements and more.

Maps

Adds a map layout to bases so you can display notes as an interactive map view.

Supercharged Links

Add attributes to internal links with the values of target note's frontmatter attributes.