All diagram types Open editor

merIDK / Diagram types / File tree diagram

Mermaid file tree diagram: example and syntax

Tree view draws a folder structure from the same text the tree command prints. It suits READMEs and docs that explain how a project is laid out.

Open this example in the editor

Example code

treeView-beta
├── src/
│   ├── app.js
│   └── templates.js
├── index.html
├── style.css
└── README.md

Result

treeView-beta
├── src/
│   ├── app.js
│   └── templates.js
├── index.html
├── style.css
└── README.md

Syntax quick reference

How to use it

  1. Open the example in the editor, or paste your own Mermaid code.
  2. Edit the code on the left. The preview updates as you type, and errors point to the line.
  3. Export SVG or PNG, copy a Markdown block for GitHub or Notion, or copy a share link.

More diagram types