Pele is a lightweight library that renders Mermaid diagrams to SVG, themed with CSS variables.
How it works
Open in PlaygroundPass Mermaid text to Pele. It returns an SVG.
Mermaid
1flowchart TD2 A[Mermaid text] --> B{Flowchart?}3 B -- Yes --> C[Pele]4 B -- No --> D[Mermaid]5 C --> E([SVG])6 D --> EPele
The SVG has no colors of its own. Set a few CSS variables and every diagram follows your theme, without being rendered again.
CSS
1.pele {2 --pele-bg: #fffcf0;3 --pele-fg: #100f0f;4 --pele-muted: #6f6e69;5 --pele-line: #100f0f;6 --pele-surface: #f2f0e5;7 --pele-surface-alt: #e6e4d9;8 --pele-border: #cecdc3;9}Pele
Pele in your app
Add Pele to your app using the API.
1npm install @kepano/pele1pnpm add @kepano/pele1yarn add @kepano/pele1bun add @kepano/pele1import { render } from '@kepano/pele';23const { svg } = render(`flowchart LR4 A[Mermaid text] --> B[SVG]`);56document.querySelector('#diagram').innerHTML = svg;Explore
Examples
Every diagram type that Pele draws.
API
Render diagrams, inspect them, and handle errors.
Theming
Set colors and fonts with CSS variables.
Compatibility
What Pele shares with Mermaid, and where it differs.
Pele in use
Pele is open source. It is being built for Obsidian, to draw the Mermaid diagrams in your notes quickly and in the colors of your theme. Any app can use it. Pele is named after Pele, the Polynesian goddess of volcanoes and fire.