Using mermaid
EventCatalog supports mermaid (v11.x) in all your markdown files.
This let's you create Class Diagrams, Sequence Diagrams, Entity Relationship Diagrams, Architecture Diagrams and much more.
Using mermaid in EventCatalog
There are two ways to use mermaid in EventCatalog.
- Using the
mermaidcode block in any markdown file. - Using Mermaid files
.mmdand.mermaidfiles and loading them into your EventCatalog page.- Added in EventCatalog 2.56.4
If you have large diagrams that fail to render, increase the maxTextSize configuration value. Learn more about maxTextSize configuration.
Using the mermaid code block in any markdown file.
To use mermaid you need to use the mermaid code block in any markdown file.
Example
```mermaid
sequenceDiagram
participant Customer
participant OrdersService
participant InventoryService
participant NotificationService
Customer->>OrdersService: Place Order
OrdersService->>InventoryService: Check Inventory
InventoryService-->>OrdersService: Inventory Available
OrdersService->>InventoryService: Reserve Inventory
OrdersService->>NotificationService: Send Order Confirmation
NotificationService-->>Customer: Order Confirmation
OrdersService->>Customer: Order Placed Successfully
OrdersService->>InventoryService: Update Inventory
```_
This example will output the following in the markdown file.

Loading Mermaid files into your EventCatalog page.
eventcatalog@2.56.4You can load Mermaid files using the <MermaidFileLoader /> component, if you prefer to use a file instead of a code block.
Add your .mmd or .mermaid file to your folder (e.g /events/MyEvent/mermaid.mmd)
---
#event frontmatter
---
<!-- Using the .mmd file extension -->
<MermaidFileLoader file="mermaid.mmd" />
<!-- Using the .mermaid file extension -->
<MermaidFileLoader file="my-second-mermaid-file.mermaid" />
This example will load a mermaid file (.mmd or .mermaid) into your EventCatalog page.
The file must be in the same directory as the markdown file.
Architecture diagrams with mermaid
eventcatalog@2.18.0Mermaid 11 introduced the ability to create architecture diagrams.
You can use these diagrams to document your architecture.