Rendering engines
The package supports two renderers behind the same wrapper model
Mermaid.js
renderEngine: 'mermaidjs' is the default path
Best fit
- Standard Mermaid output
- Full theme coverage
- Sketch mode and
sketchFont - Fast iteration during authoring
ts
md.use(markdownItMermaidEnhanced, {
renderEngine: 'mermaidjs',
theme: 'auto',
})Excalidraw
renderEngine: 'excalidraw' converts Mermaid-compatible source into Excalidraw elements and then exports SVG
Best fit
- Rougher visual language
- Hand-drawn output
- Diagram reviews that benefit from lower visual polish
ts
md.use(markdownItMermaidEnhanced, {
renderEngine: 'excalidraw',
excalidrawConfig: {
flowchart: { curve: 'basis' },
themeVariables: { fontSize: '18px' },
},
})One important boundary
Excalidraw is a renderer, not a new parser. The source still has to be valid Mermaid-compatible input
What stays the same
- Wrapper markup
- Toolbar actions
- Copy and export buttons
- In-place rerender behavior
- Zoom state during config-only refreshes
What changes
| Concern | Mermaid.js | Excalidraw |
|---|---|---|
| Parser | Mermaid | Mermaid to Excalidraw conversion |
| Theme surface | Mermaid theme variables | Excalidraw app state plus limited conversion options |
| Sketch mode | Native sketch styling | Rough output comes from Excalidraw itself |
| Font sizing | Mermaid theme variables | themeVariables.fontSize in conversion config |
Inline engine switching
md
```mermaid excalidraw flowchart-curve=basis font-size="18px"
flowchart LR
Build --> Review --> Ship
```