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

logoAnt Design X

DesignDevelopmentComponentsX MarkdownX SDKPlayground
  • File Card
  • Introduction
  • Overview
  • Common
    • Bubble
    • Conversations
    • Notification
      2.0.0
  • Confirmation
    • Think
      2.0.0
    • ThoughtChain
      2.0.0
  • Wake
    • Welcome
    • Prompts
  • Express
    • Attachments
    • Sender
    • Suggestion
  • Feedback
    • Actions
    • CodeHighlighter
      2.1.0
    • Mermaid
      2.1.0
    • Sources
      2.0.0
  • Others
    • XProvider

Mermaid

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

When to Use

  • Used to render interactive Mermaid diagrams that support zooming, panning, and switching between image and code views in applications.
  • When used together with XMarkdown, it can render Mermaid diagrams within Markdown content and enhance interactive features.

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