Kroki-rs supports a wide variety of diagram types by leveraging existing CLI tools and a high-performance Native Browser Engine.
| ID | Name | Primary Format | Backend |
|---|---|---|---|
graphviz | Graphviz | SVG | dot (CLI) |
mermaid | Mermaid | SVG | Native Engine (Headless Chromium) |
bpmn | BPMN | SVG | Native Engine (Headless Chromium) |
d2 | D2 | SVG | d2 (CLI) |
ditaa | Ditaa | PNG | ditaa (CLI) |
excalidraw | Excalidraw | SVG | excalidraw-to-svg (CLI) |
vega | Vega | SVG | vg2svg (CLI) |
vegalite | Vega-Lite | SVG | vl2vg & vg2svg (CLI) |
wavedrom | WaveDrom | SVG | wavedrom-cli (CLI) |
Native Browser Engine (Mermaid & BPMN)¶
Starting from v0.0.8, Mermaid and BPMN are rendered using a native headless Chromium instance. This ensures:
Accuracy: Perfect rendering using official JS libraries.
Performance: Managed tab pooling and concurrency control.
Serverless Architecture: Uses a local
file://based harness, eliminating the need for internal HTTP servers or loopback networking.Zero-Dependency Core: No local Node.js or Playwright installation required (all assets are embedded).
High-Performance Font Support¶
Our Native Engine features a robust font-management system:
Google Fonts: Supported out-of-the-box via internet access in headless mode.
Dynamic Injection: You can inject custom CSS (e.g.,
@font-faceor@import) into the rendering harness at runtime via thewindow.krokiFontCssconfiguration.Consistency: Automatically uses
--font-render-hinting=noneto ensure pixel-perfect SVG generation across different operating systems.
Installation of Tools¶
Most tools can be installed via your system package manager.
macOS (Homebrew)¶
brew install graphviz d2 ditaa
# For Mermaid/BPMN rendering, kroki-rs uses its native engine;
# however, an external browser is recommended for local development:
brew install --cask chromiumNote on Format¶
While Kroki-rs supports SVG, PNG, and PDF, SVG is the recommended format for most web-based documentation as it provides the best clarity and scalability.