1. Organization Components
  2. File Trees

Use Tree to explain where files belong. It displays a structure; it does not read your filesystem or turn file names into links.

​
Example

docs
layout.json
quickstart.mdx
guides
installation.mdx
publishing.mdx
<Tree>
  <Tree.Folder name="docs" defaultOpen>
    <Tree.File name="layout.json" />
    <Tree.File name="quickstart.mdx" />
    <Tree.Folder name="guides" defaultOpen>
      <Tree.File name="installation.mdx" />
      <Tree.File name="publishing.mdx" />
    </Tree.Folder>
  </Tree.Folder>
</Tree>

Click a folder to open or close it. With the tree focused, use arrow keys to move between items and expand or collapse folders. Home and End move to the first and last visible items. Type a file or folder name to move focus to a matching item.

​
Properties

ComponentPropertyDefaultPurpose
TreechildrenRequiredTree.Folder and Tree.File entries.
TreeclassNameNoneOptional styling classes.
Tree.FoldernameRequiredFolder label.
Tree.FolderdefaultOpenfalseStart with the folder expanded.
Tree.FolderopenabletrueAllow expansion when children exist. Set to false for a folder label with no expandable content.
Tree.FolderchildrenNoneNested folders and files.
Tree.FilenameRequiredFile label.

​
Desktop example

Expanded docs file tree containing layout.json, quickstart and a guides folder

Readers can expand folders to inspect a file structure.