Pele guide

Pele Renderer: Mermaid Syntax, Themes and Integration

Learn how Pele renders Mermaid diagrams, where its themes and layout differ, and which library features are available in Pele Editor.

Mermaid · Pele · Pele Editor

Mermaid is the source syntax. Pele 1.6.0 is the default renderer; you can select Mermaid.js 12.2.0 in the editor. Pele Editor provides editing and export. Layout differs between engines.

Pele uses CSS variables; Mermaid themeVariables are not equivalent settings. The library supports links and external images, but this site disables them. Site theme and diagram palette are separate. For integration, use the API and CSS examples below.

Pele 1.6.0Pele Editor
The main package includes all diagram types. Applications with a narrower scope can use pele/core and register the types they need. The pele/lazy entry point offers asynchronous loading. In a browser, mount handles container and font measurement; a plain render call leaves those surrounding decisions to the caller. Choose the entry point around your application’s loading and sizing requirements, rather than assuming every integration needs the same bundle.This website adds live editing, templates, conversion tools, source downloads and image exports around Pele 1.6.0. The diagram palette and the website’s light or dark interface are separate choices. For this editor, diagram links and external images are disabled, and automatic direction changes are disabled. Library options described in integration documentation should not be read as settings that are all enabled here.

Editor ↗ · Pele API ↗ · Pele · Help ↗

Pele vs Mermaid.js: what changes, what stays portable

Pele Editor guide · Published

Render a diagram without a browser UI

Pele 1.6.0 exposes a synchronous render function that returns SVG. This is useful when your application already controls the editing interface or needs to generate diagrams as part of a document pipeline. Pass diagram source to the library and use the returned SVG in your output. Keep the package version pinned when repeatable output matters.

import { render } from "pele";

const { svg } = render("flowchart LR\n  A[Draft] --> B[Review]");
// Write svg to your document or an SVG file.

Let CSS carry the palette

Pele exposes colors through CSS custom properties, so a host page can give diagrams the same palette as its interface. Set those properties on a wrapper around an inline diagram. The example below defines a restrained dark palette. These are integration styles, not lines to paste into the diagram source editor. A downloaded SVG also needs usable colors when it leaves that wrapper.

.diagram {
  --pele-bg: #101827;
  --pele-fg: #e5edf7;
  --pele-line: #94a3b8;
  --pele-surface: #1e293b;
  --pele-accent: #38bdf8;
}

Choose how the library enters your app

The main package includes all diagram types. Applications with a narrower scope can use pele/core and register the types they need. The pele/lazy entry point offers asynchronous loading. In a browser, mount handles container and font measurement; a plain render call leaves those surrounding decisions to the caller. Choose the entry point around your application’s loading and sizing requirements, rather than assuming every integration needs the same bundle.

Handle editing errors deliberately

In version 1.6.0, mount and update expose parse errors while keeping the last successful diagram visible with an error overlay. Applications using render directly still need to catch errors. An editing interface should distinguish incomplete text from a successful new result, especially when users type one character at a time.

What you can use in Pele Editor

This website adds live editing, templates, conversion tools, source downloads and image exports around Pele 1.6.0. The diagram palette and the website’s light or dark interface are separate choices. For this editor, diagram links and external images are disabled, and automatic direction changes are disabled. Library options described in integration documentation should not be read as settings that are all enabled here.

Try it in the editor ↗