Pele turns Mermaid diagram text into SVG in the browser or Node, with no runtime dependencies and styling through CSS variables.
Overview
Pele is a small library that parses Mermaid diagram syntax and renders the result as SVG. It targets the same diagram vocabulary as Mermaid 12.1.0 while providing its own layout and visual style.
The design emphasizes synchronous rendering, zero declared runtime dependencies, and theming via CSS variables for colors and fonts. Chart series can use named CSS variables, and theme changes can apply without re-rendering the diagram. A mount API fits browser use by adapting layout to container width and reading fonts from CSS.
Consumers can install via npm and import a main entry that includes all diagram types, or register diagram types individually to reduce bundle size. Documentation and a playground are published separately. Security-related behavior includes escaping diagram text, filtering links and styles, and limiting source and output size for untrusted input.
Compared to Mermaid.js in benchmarks described in the project materials, Pele reports smaller gzipped bundles and lower render times on the same diagrams, with layout that adapts on small screens rather than only scaling the graphic.
Key features
- Mermaid syntax to SVG
- CSS variable theming
- Synchronous rendering
- No runtime dependencies
- All Mermaid 12.1.0 diagram types
- On-demand diagram type loading
- Untrusted diagram safeguards
- Browser mount API
Use cases
- In-app Mermaid diagrams
- Themeable documentation charts
- Low-latency diagram previews
- Obsidian-style diagram rendering
- CDN or npm front-end embeds