Files
The <Files> component creates visual file tree structures with expandable folders and nested files. Use it to show project structures, directory layouts, or any hierarchical file organization in your documentation.
The component consists of three parts: <Files> as the container, <Folder> for directories, and <File> for individual files.
Usage
Variants
Nested folders
You can nest folders within folders to create deep directory structures. The component automatically adds visual nesting lines to show the hierarchy.
Linked files and folders
Add the href property to make files or folders clickable. This is useful for linking to documentation pages, GitHub repositories, or other resources.
Default open folders
Use the defaultOpen property to have specific folders expanded when the page loads. This is useful for highlighting important directories or showing the most relevant parts of a file structure.
Properties
<Files> properties
The file tree content. Should contain <Folder> and <File> components.
Optional CSS class name for custom styling.
<Folder> properties
The folder name to display.
Whether the folder should be expanded when the page loads. If not specified, the folder will be collapsed by default.
The nested content within the folder. Can include <File> and other <Folder> components.
Optional URL to make the folder name clickable. The name will show an underline on hover when a link is provided.
Optional CSS class name for custom styling.
<File> properties
The file name to display.
Optional URL to make the file name clickable. The name will show an underline on hover when a link is provided.
Optional CSS class name for custom styling.