Skip to content

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

ConcernMermaid.jsExcalidraw
ParserMermaidMermaid to Excalidraw conversion
Theme surfaceMermaid theme variablesExcalidraw app state plus limited conversion options
Sketch modeNative sketch stylingRough output comes from Excalidraw itself
Font sizingMermaid theme variablesthemeVariables.fontSize in conversion config

Inline engine switching

md
```mermaid excalidraw flowchart-curve=basis font-size="18px"
flowchart LR
  Build --> Review --> Ship
```