`:
```html
Here is a mermaid diagram:
graph TD
A[Client] --> B[Load Balancer]
B --> C[Server01]
B --> D[Server02]
```
> **Note**
> Every Mermaid chart/graph/diagram definition should have separate `` tags.
- This is an example of a Mermaid import and the `mermaid.initialize()` call.
> **Note**
> A `mermaid.initialize()` call takes all the definitions contained within `` tags and renders them into diagrams.
```html
```
> **Note**
> Rendering in Mermaid is initialized by the `mermaid.initialize()` call. However, doing the opposite lets you control when it starts looking for `` tags inside the web page with `mermaid.initialize()`. This is useful when you think that not all `` tags may have loaded on the execution of `mermaid.esm.min.mjs` file.
`startOnLoad` is one of the parameters that can be defined by `mermaid.initialize()`
| Parameter | Description | Type | Values |
| ----------- | --------------------------------- | ------- | ----------- |
| startOnLoad | Toggle for Rendering upon loading | Boolean | true, false |
In this example, the `mermaidAPI` is being called through the `CDN`:
```html
Here is one mermaid diagram:
graph TD
A[Client] --> B[Load Balancer]
B --> C[Server1]
B --> D[Server2]
And here is another:
graph TD
A[Client] -->|tcp_123| B
B(Load Balancer)
B -->|tcp_456| C[Server1]
B -->|tcp_456| D[Server2]
```
In this example, `mermaid.js` is referenced in `src` as a separate JavaScript file:
```html
graph LR
A --- B
B-->C[fa:fa-ban forbidden]
B-->D(fa:fa-spinner);
graph TD
A[Client] --> B[Load Balancer]
B --> C[Server1]
B --> D[Server2]
```
## 5. Adding Mermaid as a dependency
Below are the steps for adding Mermaid as a dependency:
1. Install `node v16`
> **Note**
> To learn more about downloading and installing `Node.js` and `npm`, visit the [npm Docs website](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm).
1. Install `yarn` using `npm` with this command:
`npm install -g yarn`
2. After yarn installs, enter this command:
`yarn add mermaid`
3. To add Mermaid as a dev dependency, enter this command:
`yarn add --dev mermaid`
## Closing note
> **Note**
> Comments from Knut Sveidqvist, creator of Mermaid:
>
> - In early versions of Mermaid, the `