Participate in the WeaveFox "AI Artist" contest to win SEE Conf tickets and thousands of prizes

logoAnt Design X

DesignDevelopmentComponentsX MarkdownX SDKPlayground
  • Introduction
  • Overview
  • Common
    • Bubble
    • Conversations
    • Notification
  • Wake
    • Welcome
    • Prompts
  • Express
    • Attachments
    • Sender
    • Suggestion
  • Expression
    • CodeHighlighterCode Highlighting
    • MermaidDiagram Tool
  • Confirmation
    • Sources
    • Think
    • ThoughtChain
  • Feedback
    • Actions
    • FileCard
  • Others
    • XProvider

Mermaid
Diagram Tool

Used to render diagrams with Mermaid.
Importimport { Mermaid } from "@ant-design/x";
Sourcecomponents/mermaid
Docs
Edit this page...
Changelog
loading

When to Use

  • Need to render Mermaid diagrams in the application
  • Want to provide interactive features like zoom, pan, and code view
  • Need to support both image and code view modes

Code Demo

API

PropertyDescriptionTypeDefault
childrenCode contentstring-
headerHeaderReact.ReactNode | nullReact.ReactNode
classNameStyle class namestring
classNamesStyle class namestring-
highlightPropsCode highlighting configurationhighlightProps-

Semantic DOM

Theme Variables (Design Token)

Component TokenHow to use?
Token NameDescriptionTypeDefault Value
colorBgTitleTitle background colorstringrgba(0,0,0,0.06)
colorBorderCodeCode block border colorstring#f0f0f0
colorBorderGraphGraph border colorstring#f0f0f0
colorTextTitleTitle text colorstringrgba(0,0,0,0.88)
Global TokenHow to use?
Basic
CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
Custom Header
CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
With XMarkdown
CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
流程图示例
  • root
    root
  • header
    Wrapper element of the header
  • graph
    Wrapper element of the graph
  • code
    Wrapper element of the code