---
title: "MermaidKit"
description: "Native Mermaid renderer in pure Swift: no JavaScript, no WebView, zero dependencies. All 30 diagram types on six platforms with byte-identical output."
canonical_url: "https://2389.ai/research/products/mermaidkit/"
last_updated: "2026-08-25T13:00:12-05:00"
doc_version: "1.0"
date: 2026-09-01
product_type: "Tool"
status: "Beta"
tags: ["swift", "mermaid", "diagrams", "rendering", "cross-platform", "ios", "macos", "android", "open-source"]
---

# MermaidKit

> Native Mermaid renderer in pure Swift: no JavaScript, no WebView, zero dependencies. All 30 diagram types on six platforms with byte-identical output.


MermaidKit is a native Mermaid renderer written in pure Swift: no JavaScript, no WebView, zero dependencies. You hand it Mermaid source and it hands back a drawn diagram synchronously; parsing and layout usually finish in under 15 milliseconds on Apple silicon. It exists because embedding a whole browser to draw a box with an arrow pointing at another box got old.

## Install

Tagged releases install through Swift Package Manager:

```swift
.package(url: "https://github.com/2389-research/MermaidKit", from: "2.2.0")
```

Link `MermaidRender` for drawing on Apple platforms, or `MermaidLayout` alone for platform-free parsing and layout. Android, Windows/.NET, Flutter, and WebAssembly consume the same core over the C ABI; the [README](https://github.com/2389-research/MermaidKit) covers each binding.

In SwiftUI, a diagram is one view:

```swift
MermaidView("""
flowchart TD
    A[Start] --> B{Choice}
    B -->|yes| C[Do it]
    B -->|no| D[Skip]
""")
```

## What it does

**All 30 Mermaid diagram types.** Flowcharts, sequence diagrams, Gantt charts, ER diagrams, state machines, Sankey flows, and the rest. Every type renders in the [gallery](https://2389-research.github.io/MermaidKit/#gallery), in light and dark, drawn by MermaidKit itself.

**Six platforms, byte-identical output.** One Swift core parses the diagram and works out where every box, arrow, and label goes, then hands the finished layout to each platform as SceneWire, a small JSON scene description. Apple devices draw it with CoreGraphics, Linux with Cairo, Android, Windows, and Flutter with Skia, browsers with SVG or Canvas2D. The core is deterministic, and automated tests prove the output identical down to the byte across all five compile targets.

**Native behavior.** Diagrams follow light and dark mode, size themselves to their content, and cache their results so the second render is free. Syntax MermaidKit can't parse falls back to readable monospaced text instead of a blank rectangle.

**More than Mermaid.** The same pipeline accepts Graphviz DOT (in and out, so it doubles as a two-way converter between Mermaid and DOT), [Dippin](https://dippin.org) `.dip` pipeline files, SQL DDL (`CREATE TABLE` statements become ER diagrams), and raw `git log` output, rendered as a git graph straight in your terminal.

## Limitations

MermaidKit covers the core syntax of each diagram type plus a long list of everyday extras. It is not a complete copy of mermaid.js, and the README's [support table](https://github.com/2389-research/MermaidKit#supported-diagram-types--honestly) spells out exactly what's covered. Styling directives like `classDef` are skipped rather than errored, because theming is native. A geometric linter runs on every change, verifying that lines don't cut through boxes, labels don't clip, and layout stays stable from one run to the next.

## Requirements

- Swift 6.2+ toolchain for Swift Package Manager consumers
- No runtime dependencies: no JavaScript engine, no WebView
- Linux rasterization draws with Cairo via Silica, opt-in through the `LinuxRaster` package trait


## Sitemap

Parent: [Products](https://2389.ai/research/products/index.md)

Related pages in this section:

- [Skills Marketplace](https://2389.ai/research/products/skills-marketplace/index.md)
- [Mammoth](https://2389.ai/research/products/mammoth/index.md)
- [BotBoard](https://2389.ai/research/products/botboard/index.md)
- [Smasher](https://2389.ai/research/products/smasher/index.md)
- [Jeff](https://2389.ai/research/products/jeff/index.md)
- [Mux](https://2389.ai/research/products/mux/index.md)
- [ISH](https://2389.ai/research/products/ish/index.md)
- [Coven](https://2389.ai/research/products/coven/index.md)
- [Soloclaw](https://2389.ai/research/products/soloclaw/index.md)
- [ccvault](https://2389.ai/research/products/ccvault/index.md)


Site index: [llms.txt](https://2389.ai/llms.txt) · [sitemap.md](https://2389.ai/sitemap.md) · [HTML](https://2389.ai/research/products/mermaidkit/)
