File Tree
Display hierarchical file and folder structure with expand/collapse functionality.
The FileTree component displays a hierarchical file system structure with expandable folders and file selection.
Install using CLI
Install Manually
Copy and paste the following files into the same folder.
Features
- Hierarchical file/folder display
- Expand/collapse folders
- Selection handling
- Controlled and uncontrolled modes
- Customizable icons
- Keyboard navigation
Examples
Basic Usage
With Selection
Default Expanded
Props
<FileTree />
expandedSet<string>
defaultExpandedSet<string>
selectedPathstring
@update:selected-path(path: string) => void
@expandedChange(expanded: Set<string>) => void
...propsHTMLAttributes
<FileTreeFolder />
pathrequiredstring
namerequiredstring
...propsHTMLAttributes
<FileTreeFile />
pathrequiredstring
namerequiredstring
iconSlot
...propsHTMLAttributes
<FileTreeIcon />
...propsHTMLAttributes
<FileTreeName />
...propsHTMLAttributes
<FileTreeActions />
...propsHTMLAttributes