Skip to Content
zjkm-ui-ai-elements

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.

Loading preview…

Installation

npm i zjkm-ui-ai-elements
import {  FileTree,  FileTreeIcon,  FileTreeName,  FileTreeFolder,  FileTreeFile,  FileTreeActions,} from "zjkm-ui-ai-elements/file-tree";

First time? Add the package's styles: see Setup.

Features

  • Hierarchical folder structure
  • Expand/collapse folders
  • File selection with callback
  • Keyboard accessible
  • Customizable icons
  • Controlled and uncontrolled modes

Examples

Basic Usage

Loading preview…

With Selection

Loading preview…

Default Expanded

Loading preview…

Props

<FileTree />

Prop

Type

<FileTreeFolder />

Prop

Type

<FileTreeFile />

Prop

Type

Subcomponents

  • FileTreeIcon - Icon wrapper
  • FileTreeName - Name text
  • FileTreeActions - Action buttons container (stops click propagation)

On this page