Looking for Pelé the footballer? Go to his wiki

Live demos of Pele

Pele is kepano's open-source library that renders Mermaid diagrams to SVG, themed with CSS variables. The official docs at pele.run are excellent and the place to start: a playground, the full API, every diagram type, and the thinking behind it. This independent site is a companion to them. It runs the real package in your browser next to Mermaid.js, so you can see the difference for yourself.

Try it ↓ Official docs ↗

Type a diagram

Press Auto-type, or type in the box. Both redraw on every keystroke.

Peleeach redraw –
Mermaid.jseach redraw waiting…

Six demos

Each runs pele 1.6.0 in your browser. Most run Mermaid.js 12.1.0 beside it, with the same text, and time both.

  1. Demo 1TypingBoth libraries redraw on every keystroke. Compare the times.
  2. Demo 2StreamingA diagram redrawn on each chunk of an AI answer.
  3. Demo 3ThemingChange CSS variables. Pele recolours without a redraw.
  4. Demo 4Narrow screensResize the viewport. Pele changes the layout; Mermaid.js scales the drawing.
  5. Demo 5200 diagrams on one pageHow long each library takes to draw a long documentation page.
  6. Demo 6Untrusted inputScripts, bad links and oversized diagrams, and what reaches the page.

What is Pele?

Pele is a JavaScript library that turns Mermaid diagram text into SVG. kepano wrote it for Obsidian, so that diagrams draw instantly and match the user's theme. MIT licensed.

It takes the same text you would give Mermaid.js and returns an SVG string, synchronously:

import { render } from 'pele'

const { svg } = render(`flowchart LR
  A[Mermaid text] --> B[SVG]`)
document.querySelector('#diagram').innerHTML = svg

It supports every diagram type built into Mermaid 12.1.0, uses its own layout, and takes colours and fonts from CSS variables. More in What is Pele? and Getting started.

Where it helps

Pele's speed matters when diagrams are drawn often, live, or in bulk:

Keep Mermaid.js if you need its exact look, JavaScript click callbacks, or plugins such as ZenUML. See Pele vs Mermaid.js.