Files
Ethan Palm 6c53a28e3a Document className and Tailwind arbitrary value support (#7301)
* Document className and Tailwind arbitrary value support

All built-in components now accept a className prop (mint#10540), and
dynamic Tailwind utilities work in className on MDX components
(mint#6737). Two pages stated the opposite.

- Correct the claims that Tailwind arbitrary values are unsupported in
  customize/custom-scripts and guides/custom-layouts
- Add className and arbitrary value guidance to the Tailwind section of
  custom-scripts, including the runtime-class limitation and the Tab
  content-panel caveat
- Add a Style components section to the components overview
- Add className property rows to every component reference page that
  supports it, and note the three components that do not
- Document inline Markdown support in component title props
- Correct the callouts page, which said typed callouts accept only
  children
- Replace inline style resizing with Tailwind classes in image embeds
- Add a help center article for Tailwind classes not applying in the
  editor's live preview, and note the limitation in custom-layouts
- Point skill.md at className before custom.css
- Accept className, keyframes, and unstyled in the Vale vocabulary

Resolves DOC-316, DOC-317

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Apply batched suggestions from code review

Co-authored-by: Ethan Palm <56270045+ethanpalm@users.noreply.github.com>

* Apply batched suggestions from code review

Co-authored-by: Ethan Palm <56270045+ethanpalm@users.noreply.github.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-08 16:54:20 -07:00

132 lines
3.6 KiB
Plaintext

---
title: "Mermaid"
description: "Create flowcharts, sequence diagrams, and other visualizations in your documentation using Mermaid syntax with automatic rendering."
keywords: ["Mermaid", "flowcharts", "diagrams"]
boost: 3
---
[Mermaid](https://mermaid.js.org/) lets you build flowcharts, sequence diagrams, Gantt charts, and other diagrams using text and code.
For a complete list of supported diagram types and syntax, see the [Mermaid documentation](https://mermaid.js.org/intro/).
```mermaid placement="top-right"
flowchart LR
subgraph subgraph1
direction TB
top1[top] --> bottom1[bottom]
end
subgraph subgraph2
direction TB
top2[top] --> bottom2[bottom]
end
%% ^ These subgraphs are identical, except for the links to them:
%% Link *to* subgraph1: subgraph1 direction is maintained
outside --> subgraph1
%% Link *within* subgraph2:
%% subgraph2 inherits the direction of the top-level graph (LR)
outside ---> top2
```
````mdx Mermaid flowchart example
```mermaid placement="top-right"
flowchart LR
subgraph subgraph1
direction TB
top1[top] --> bottom1[bottom]
end
subgraph subgraph2
direction TB
top2[top] --> bottom2[bottom]
end
%% ^ These subgraphs are identical, except for the links to them:
%% Link *to* subgraph1: subgraph1 direction is maintained
outside --> subgraph1
%% Link *within* subgraph2:
%% subgraph2 inherits the direction of the top-level graph (LR)
outside ---> top2
```
````
## ELK layout support
Mintlify supports the [ELK (Eclipse Layout Kernel)](https://www.eclipse.org/elk/) layout engine for Mermaid diagrams. ELK optimizes arrangement to reduce overlapping and improve readability, which is useful for large or complex diagrams.
To use ELK layout in your Mermaid diagrams, add the `%%{init: {'flowchart': {'defaultRenderer': 'elk'}}}%%` directive at the beginning of your diagram:
````mdx ELK layout example
```mermaid
%%{init: {'flowchart': {'defaultRenderer': 'elk'}}}%%
flowchart LR
A[Start] --> B[Process 1]
B --> C[Process 2]
B --> D[Process 3]
C --> E[End]
D --> E
```
````
## Interactive controls
All Mermaid diagrams include interactive zoom and pan controls. By default, controls appear when the diagram height exceeds 120px.
- **Zoom in/out**: Use the zoom buttons to increase or decrease the diagram scale.
- **Pan**: Use the directional arrows to move around the diagram.
- **Reset view**: Click the reset button to return to the original view.
The controls are especially useful for large or complex diagrams that don't fit entirely in the viewport.
## Properties
<ResponseField name="actions" type="boolean">
Show or hide the interactive controls. When set, this overrides the default behavior (controls shown when diagram height exceeds 120px).
</ResponseField>
<ResponseField name="placement" type="string" default="bottom-right">
Position of the interactive controls. Options: `top-left`, `top-right`, `bottom-left`, `bottom-right`.
</ResponseField>
<ResponseField name="className" type="string">
Additional CSS classes to apply to the diagram container.
</ResponseField>
### Examples
Hide controls on a diagram:
````mdx
```mermaid actions={false}
flowchart LR
A --> B
```
````
Show controls in the top-left corner:
````mdx
```mermaid placement="top-left"
flowchart LR
A --> B
```
````
Combine both properties:
````mdx
```mermaid placement="top-left" actions={true}
flowchart LR
A --> B
```
````
## Syntax
To create a Mermaid diagram, write your diagram definition inside a Mermaid code block.
````mdx
```mermaid
// Your mermaid diagram code here
```
````