Technical docs and engineering blogs often rely on Mermaid to illustrate system flows. Writing relationships as plain text like A --> B turns them into shapes and arrows while keeping diagrams easy to version alongside code. On documentation sites with dozens of diagrams, rendering speed and visual styling quickly become noticeable.

Pele is an open-source library that renders Mermaid syntax into SVG. The original Threads post highlights its rendering speed, bundle size, and theming model. Drawing on the official repository and documentation, here is what Pele replaces and what to check before swapping it into existing Mermaid pages.

Turning Mermaid Syntax into SVG

Working with Mermaid separates the plain-text diagram definition from the renderer that draws it on screen. Here is a basic Mermaid flowchart:

flowchart LR
  A[Request Received] --> B{Review Needed?}
  B -->|Yes| C[Assigned Review]
  B -->|No| D[Completed]
  C --> D

flowchart LR defines a left-to-right flowchart where square brackets create standard nodes, curly braces mark decision branches, and arrows connect steps. A renderer parses this text into a visual diagram flowing from intake through review to completion.

Pele takes that Mermaid text and outputs SVG - a scalable vector image format for shapes, lines, and text that embeds cleanly in web pages and styles via CSS.

Published under Obsidian’s GitHub organization with kepano listed as package author, Pele is described on its official site as built for Obsidian. Embedding the library into your own website is separate from changing the built-in renderer in your installed Obsidian version, so check Obsidian release notes for app-level adoption.

Bundle Size, Rendering Speed, and CSS Theming

The official site notes zero runtime dependencies, a smaller bundle, and faster rendering than Mermaid.js. Zero dependencies here refers specifically to Pele’s own npm runtime dependencies rather than your broader web stack.

In the project’s published comparison, gzipped bundle size drops from 1.6MB for Mermaid.js to 230kB for Pele, with rendering reported up to 500x faster. Treat those numbers as author-published benchmarks rather than a guarantee that every diagram or full page load speeds up by the same factor.

In real deployments, test against your own diagram types, node counts per page, font loading behavior, and target browsers, since a small three-node flowchart behaves very differently from a page with several long sequence diagrams.

Theming works through CSS custom properties. You can bind background, text, and connector colors directly to your site’s stylesheet and switch between light and dark modes without re-rendering the SVG - a clean fit for documentation sites with theme toggles.

Testing Pele with Code Examples

The fastest way to test existing diagrams is pasting Mermaid source into the official Playground to check syntax support and node routing before installing anything.

For a web project, install the package via npm:

npm install pele

The core render() API accepts Mermaid source text and returns an SVG string. The snippet below assumes a JavaScript module bundler environment rather than an inline script tag in a raw HTML file:

import { render } from 'pele';

const source = `flowchart LR
  A[Request Received] --> B[Assigned Review]
  B --> C[Completed]`;

const { svg } = render(source);
document.querySelector('#diagram').innerHTML = svg;

Pair it with a target container element in the DOM:

<div id="diagram"></div>

Here source holds the Mermaid definition, svg holds the rendered markup, and the final line injects it into #diagram (which must already exist when the script runs).

For responsive layouts that adapt to container width changes, check mount() in the API docs :

import { mount } from 'pele';

const container = document.querySelector('#diagram');
const source = `flowchart LR
  A[Draft] --> B[Review] --> C[Publish]`;

mount(container, source);

Use render() when you want a raw SVG string and mount() when binding directly to a live DOM element that resizes. Both APIs run synchronously, and Pele also exposes lazy entry points if you prefer loading diagram types on demand.

Matching Light and Dark Site Themes

The theming guide sets CSS custom properties on .pele or a parent wrapper element:

.pele {
  --pele-bg: #ffffff;
  --pele-fg: #1f1f1f;
  --pele-line: #6e6e6e;
  --pele-surface: #f3f3f3;
  --pele-border: #8a8a8a;
}

@media (prefers-color-scheme: dark) {
  .pele {
    --pele-bg: #1f1f1f;
    --pele-fg: #eeeeee;
    --pele-line: #aaaaaa;
    --pele-surface: #303030;
    --pele-border: #777777;
  }
}

--pele-bg, --pele-fg, and --pele-line control background, label text, and edge colors. The snippet above follows OS color-scheme preferences; if your site uses a manual theme toggle button, swap the media query for your site’s theme class or data attribute.

Keep color swaps distinct from font changes: changing font families alters glyph widths, which requires recalculating node box dimensions. Inline colors hardcoded inside a Mermaid definition can also override CSS theme variables.

Syntax Compatibility Does Not Mean Identical Visual Layout

According to the compatibility docs , Pele supports all built-in diagram types from Mermaid 12.1.0 - including flowcharts, sequence diagrams, class diagrams, state diagrams, ER diagrams, and Gantt charts.

Because Pele uses its own layout engine and visual styling, node positions, spacing, and edge routing will differ from Mermaid.js on the exact same input text. Parsing the same syntax is not the same as pixel-identical rendering:

Area to CheckWhat to Verify Before Migrating
Diagram typesWhether all diagrams use built-in Mermaid 12.1.0 types rather than external plugins
LayoutWhether node order, spacing, connector routing, and long CJK or multi-word labels stay readable
StylingWhether custom Mermaid theme configs need migrating to Pele CSS variables
InteractivityWhether diagrams only need URL links or rely on JavaScript click callbacks
Mobile viewportsWhether scaled-down SVGs or width-responsive re-layouts fit better

Specifically, Pele does not support third-party Mermaid plugins, arbitrary HTML inside node labels, or JavaScript callbacks on click directives. Audit existing docs for those features before switching renderers.

When Pele Is Worth Evaluating

Teams already maintaining Mermaid diagrams who want smaller client bundles, faster rendering, or cleaner CSS dark-mode integration have good reason to test Pele on documentation sites, blogs, and product guides.

Rather than swapping your entire site renderer at once, compare a handful of representative diagrams side by side - mixing compact flowcharts, dense architecture graphs, long labels, and narrow mobile sequence diagrams. Note that the snippets above illustrate API usage rather than site-wide performance benchmarks.

Released under the MIT license, Pele is easy to evaluate by testing your existing Mermaid blocks in the Playground and checking the official repository .

Lead image: Project image from the official Pele repository .