DEV Community

Cover image for Render Mermaid Diagrams to SVG or ASCII with beautiful-mermaid Library
jQueryScript
jQueryScript

Posted on

Render Mermaid Diagrams to SVG or ASCII with beautiful-mermaid Library

beautiful-mermaid: a TypeScript library that renders Mermaid diagrams as SVGs or ASCII art.

Key features:

• Dual output modes (SVG for UIs, ASCII/Unicode for terminals)

• 15 built-in themes with live CSS-based switching

• Full Shiki compatibility for VS Code theme integration

• Zero DOM dependencies

• Supports flowcharts, state, sequence, class, and ER diagrams

Perfect for AI coding assistants, CLI tools, and documentation generators that need themed diagrams in both graphical and text-only environments.

👉 Blog Post

👉 GitHub Repo

👉 Live Demo

Top comments (0)