Create diagram with mermaid

Undraw My Documents

About

mermaid is a library that renders diagram/chart based on a markup definition.

To ease the creation of mermaid diagram, we have created the following component that accepts directly the mermaid diagram definition

If for any reason, you wanted to show up also the diagram definition, you can use the below mermaid component.

Syntax

To render a mermaid diagram, you just need to enclose a code block with mermaid diagram definition language inside a webcode block.

Mermaid offers a live editor that you can use to validate and develop your diagrams.

<webcode>
    <code mermaid display="none">
    ... mermaid diagram definition
    </code>
</webcode>

display=“none” is added to show you how to not print a code block but this is optional.

Example

<webcode>
<code mermaid>
stateDiagram-v2
    Direction LR
    [*] --> Still
    Still --> [*]
    Still --> Moving
    Moving --> Still
    Moving --> Crash
    Crash --> [*]
</code>
</webcode>
  • Output:
stateDiagram-v2
    Direction LR
    [*] --> Still
    Still --> [*]
    Still --> Moving
    Moving --> Still
    Moving --> Crash
    Crash --> [*]
stateDiagram-v2 Direction LR [*] --> Still Still --> [*] Still --> Moving Moving --> Still Moving --> Crash Crash --> [*]

Security

On a security level:

  • the level of security is set to strict
  • and we does not authorize script, style, iframe tag and on attribute handler.




Showcase yourself and your brand

Get free news, tips, and tricks
to create a remarkable experience for your readers.




Recommended Pages
How to create a Entity RelationShip Diagram with ComboStrap

This article shows you how to create a Entity RelationShip Diagram.
How to create a Pie Chart with ComboStrap

This article shows you how to create a Pie Chart.
How to create a class diagram with ComboStrap

This article shows you how to create a class diagram.
How to create a flowchart diagram with ComboStrap

This article shows you how to create a flowchart diagram.
How to create a gantt diagram with ComboStrap

This article shows you how to create a Gantt diagram.
How to create a sequence diagram with ComboStrap (UML)

This article shows you how to create a UML sequence diagram.
How to create a state diagram with ComboStrap

This article shows you how to create a state diagram.
How to create a user-journey diagram with ComboStrap

This article shows you how to create a user-journey diagram.
Page Explorer List Name To Ui Region
Page-explorer: adding page navigation easily to your website

With the page-explorer component, you can add an explorer like panel that will list your pages in a list or collapsible tree fashion



Task Runner