Pele
pele.run- Category
- Developer Tools
- Rank
- No. 938Tools index
Previous survey · No. 932 ·
- Pricing
- Open Source
- Type
- TOOL
- Use case
- Design & Media
- GitHub
- 4.9k stars
- Latest release
- 1.13.0
- Date
About
Pele is a lightweight open-source library that renders Mermaid diagrams to SVG and themes them through CSS variables. It has no runtime dependencies, supports every diagram type in Mermaid 12.1.0, and can adapt layout to container width. Colors change with the theme without re-rendering. It was built for Obsidian to render diagrams quickly and match the user's theme.
At a glance
Pele renders Mermaid text as SVG that can inherit colors and fonts through CSS variables. It is worth trying if diagrams need to match an app’s theme or fit a narrow documentation page.
Good fit
Web developers and documentation authors embedding Mermaid-style diagrams.
Consider something else when
Skip a direct swap if your existing diagrams rely on Mermaid features or layouts you have not compared.
Start here
Paste a representative diagram into the playground, switch themes and check the labels and edges in a narrow viewport before adopting it.
Cost and requirements
The MIT-licensed library runs in your app and takes diagram text as input. Review the renderer’s security guidance before accepting untrusted diagrams.
Limits to know
Supported diagram types do not guarantee identical output for each syntax feature. Compare the actual diagrams your users depend on.
Sources checked 2026-11-05. Source-based assessment.
Read the source review
What it does
Pele takes the plain-text notation Mermaid uses for flowcharts, sequence charts, Gantt timelines and thirty-odd other drawing kinds, and turns it into vector graphics using its own parsers and its own layout engine, written in TypeScript. One call hands back finished markup straight away, with no promise to await and no browser required. Inside a web page it can instead take over an element: it redraws when the box gets narrower or a font finishes loading, and if new text fails to parse it keeps the last good drawing, dimmed, with the error laid over its bottom edge.
Why it's ranked here
The case rests on scope and discipline. The registry lists 33 diagram types, the parsers are tested against Mermaid's own parser specs and with differential fuzzing, and the library ships with zero runtime dependencies under MIT. It is published under Obsidian's organization and built for that app, and its project notes set hard rules: drawing stays synchronous with no page access, and identical input plus the same text measurer must produce identical output. Hostile input is treated as a real case, with caps on source length, output size and edge count. That is the profile an embedding app needs.
What's good
The limits are concrete and sensible. Source text stops at 50,000 characters, matching Mermaid's default; output stops at four million characters, because a short source can describe a drawing that stalls a page; and flowcharts cap at 5,000 edges, since one short line using the ampersand shorthand can request millions. Nesting deep enough to blow the stack comes back as a named limit error, not a crash. Bundle size is in your hands: import everything, register only the types you use, or let a loader fetch each type the first time a diagram needs it. Wide diagrams can flip from running across to running down below 640 pixels.
Tradeoffs
Pele matches Mermaid's syntax, not its look. The project says it uses its own layout and visual style, so a team with existing Mermaid output should expect diagrams to come out differently. In the browser helper, markup is assigned straight into the element unless you supply a sanitizer hook, so pages showing untrusted diagrams should pass one. Gantt charts read the current time by default, which breaks byte-identical output unless you fix the clock through an option. Many of the newer types, such as Venn, Wardley and use-case diagrams, are beta in Mermaid's own naming, so their syntax may still move.
How to use it well
Reach for it when an app renders user-written Mermaid in notes, docs or chat and has to follow a light and dark theme: set the colour variables on a parent element and switching themes needs no redraw. Use the core entry with only the diagram types you support to keep bundles small, or the on-demand loader when users can write any type. Pass a sanitizer and keep the default caps if the text comes from strangers. It is the wrong pick when output must look exactly like Mermaid's.
Technical notes+
src/core.ts holds the registry map and the three caps (DEFAULT_LIMIT 50000, DEFAULT_OUTPUT_LIMIT 4_000_000, DEFAULT_MAX_EDGES 5000) and wraps parse and render in a guard that converts RangeError into a PeleError with code 'limit'. src/detect.ts copies Mermaid's detector regexes in registration order, first match wins, and src/diagrams/registry.ts registers 33 types. src/preprocess.ts parses front matter and init directives, skipping __proto__, constructor and prototype keys during config merge. src/mount.ts renders at natural width, probes once at maxWidth 1 to learn whether the type adapts, waits on document.fonts.ready, and uses innerHTML unless a sanitize option is given. The on-demand entry point maps each type to a dynamic import; scripts/build.mjs emits a full bundle, a global build and split ESM chunks. AGENTS.md states the synchronous, no-DOM, deterministic-output rules.
Observed
- License
- MIT (package manifest and README); compatibility specs ported from Mermaid, also MIT
- Language
- TypeScript, ESM only, with bundled type declarations
- Install
- npm package, plus a global browser build loadable from a CDN script tag
- Runtime dependencies
- None; package.json lists devDependencies only
- Interfaces
- Library API: synchronous render and parse, browser mount with redraw, async on-demand loading entry
- Entry points
- Full bundle, core with per-type registration, on-demand loader, one entry per diagram type
- Diagram types registered
- 33, listed in src/diagrams/registry.ts
- Default input limits
- 50,000 source characters, 4,000,000 output characters, 5,000 flowchart edges (src/core.ts)
- Node engine
- Node 20 or later declared in package.json
- Test setup
- Vitest; website playground tests excluded from the default test command
Read from README.md, package.json, src/index.ts, src/core.ts, src/detect.ts, src/diagrams/registry.ts, src/mount.ts, src/lazy.ts, src/preprocess.ts, src/types.ts, src/diagrams/flowchart/index.ts, src/diagrams/sequence/index.ts, src/models.ts, scripts/build.mjs, AGENTS.md.
Similar tools
Tags
Tech Stack
Media

Editorially curated, with community endorsements as a secondary signal. Corrections welcome.