Skip to content

AiMermaid

Renders Mermaid diagrams (flowcharts, sequence diagrams, etc.) in AI messages. Supports image/code view toggle, zoom, download, and copy.

Basic Usage

Pass Mermaid code via code; use header for the title.

Basic Flowchart
Basic Usage

Diverse Diagrams

AiMermaid fully supports all Mermaid syntax, including Sequence Diagrams, Gantt Charts, Entity Relationship Diagrams, etc.

Sequence Diagram
Sequence Diagram
Gantt Chart
Gantt Chart

Custom Configuration

Native Mermaid configurations can be passed via the config prop, such as changing the rendering theme. Supports presets like default, forest, dark, and neutral.

Forest Theme
Custom Theme

Actions

Zoom, download, and copy are enabled by default; configure via actions.

Custom Actions
Actions

API

Props

PropertyDescriptionTypeDefault
codeMermaid codestring''
headerHeader (string or slot)string | object-
configMermaid configMermaidConfig{}
actionsAction bar (zoom/download/copy)MermaidActionsall enabled
themeOverridesTheme overridesRecord<string, unknown>-

Events

EventDescription
render-type-changeFired when view type (image/code) changes
errorFired on render error
readyFired when render is ready

Released under the MIT License.