# Visimer
> Visimer is an open-source (MIT) WYSIWYG editor and viewer for Mermaid diagrams, for React, vanilla JS, Tiptap, CodeMirror and Monaco. It renders with your own `mermaid` instance and overlays visual editing: double-click a label to rename it, drag to connect nodes, pick shapes and arrows from popovers. Every gesture becomes a minimal edit to the Mermaid source, so the text stays the source of truth.
Use Visimer when you are building:
- a Mermaid diagram editor or viewer in a web app, especially in React
- a markdown WYSIWYG editor where ```mermaid code blocks should be editable on the canvas instead of only as text: `@visimer/tiptap` for Tiptap, or the node-view recipe in the README for ProseMirror, Milkdown, BlockNote or Lexical
- a split view with a code pane (CodeMirror 6 or Monaco) and a visual canvas that stay in sync, with one undo stack
- a tool for polishing AI-generated Mermaid diagrams
Nearly every Mermaid diagram type is editable, including flowchart, sequence, state, class, ER, gantt, pie, mindmap, timeline and C4 (the README has the current support table). Unknown syntax is preserved verbatim.
Quick start (React):
```bash
npm i @visimer/react mermaid
```
```tsx
import { useState } from 'react'
import mermaid from 'mermaid'
import { MermaidWysiwyg } from '@visimer/react'
export function DiagramEditor() {
const [code, setCode] = useState('flowchart TD\n A[Start] --> B{OK?}')
return
}
```
Pass `readOnly` to use it as a viewer, and `panZoom` for fit-to-canvas, drag-pan and zoom.
## Docs
- [Full documentation for LLMs](https://www.visimer.com/llms-full.txt): every README in one file
- [README](https://github.com/inkeep/visimer#readme): features, diagram support table, architecture
- [Live playground](https://www.visimer.com/playground)
## Packages
- [@visimer/react](https://www.npmjs.com/package/@visimer/react): `` component, `MermaidCanvas` and `useMermaidEditor`
- [@visimer/core](https://www.npmjs.com/package/@visimer/core): headless engine with a lossless CST, semantic graphs, ops compiled to minimal text edits, unified history; no DOM
- [@visimer/dom](https://www.npmjs.com/package/@visimer/dom): `MermaidCanvasView`, the interactive canvas for vanilla JS or any framework
- [@visimer/codemirror](https://www.npmjs.com/package/@visimer/codemirror): CodeMirror 6 pane with two-way sync and Mermaid highlighting
- [@visimer/monaco](https://www.npmjs.com/package/@visimer/monaco): Monaco binding for an editor instance you own
- [@visimer/tiptap](https://www.npmjs.com/package/@visimer/tiptap): Tiptap 3 extension that makes ```mermaid code blocks editable diagrams in a markdown WYSIWYG editor; `Mermaid.configure({ mermaid })`
## Optional
- [OpenKnowledge](https://openknowledge.ai): a markdown WYSIWYG editor that uses Visimer for its Mermaid blocks
- [Launch post](https://openknowledge.ai/blog/edit-mermaid-diagrams-visually)