---
title: "Files"
subtitle: "<Files> (alias <Tree>) is a collapsible file tree."
---

A collapsible file tree (aliases `<Tree>`, `<FileTree>`; `<Tree.Folder>` and `<Tree.File>` work too):

```mdx
<Files>
  <Folder name="my-docs" defaultOpen>
    <File name="docs.yml" highlighted comment="site config" />
    <Folder name="pages" defaultOpen>
      <File name="introduction.mdx" href="/guides/get-started/introduction" />
    </Folder>
    <Folder name="assets">
      <File name="logo.svg" />
    </Folder>
  </Folder>
</Files>
```

<Files>
  <Folder name="my-docs" defaultOpen>
    <File name="docs.yml" highlighted comment="site config" />
    <Folder name="pages" defaultOpen>
      <File name="introduction.mdx" href="/guides/get-started/introduction" />
    </Folder>
    <Folder name="assets">
      <File name="logo.svg" />
    </Folder>
  </Folder>
</Files>

Props shared by `<Folder>` and `<File>`:

<ParamField path="name" type="string" required>Displayed name.</ParamField>
<ParamField path="href" type="url">Makes the name a link.</ParamField>
<ParamField path="highlighted" type="boolean" default="false">Accent-colored background.</ParamField>
<ParamField path="comment" type="string">Monospace comment after the name (shown starting with `#`).</ParamField>
<ParamField path="icon" type="icon">Custom icon.</ParamField>
<ParamField path="defaultOpen" type="boolean" default="false">`<Folder>` only: open by default (`open` also works).</ParamField>
