File Tree

A React file tree for code editor sidebars with icons by file type, git status letters, spring folder animation, a filter that expands matches and full keyboard support.

src/registry/ui/file-tree.tsx/r/file-tree.json

Installation#

bash
npx shadcn@latest add https://ui.minidev.pro/r/file-tree.json

Usage#

tsx
import { FileTree } from "@/components/ui/file-tree"

export function Example() {
  return <FileTree />
}

API reference#

FileTree props
PropTypeDefault
dataFileTreeNode[]SAMPLE
defaultExpandedstring[]["app", "app/dashboard", "components"]
selectedstring-
defaultSelectedstring"app/dashboard/page.tsx"
activePathstring-
onSelect(path: string) => void-
searchablebooleantrue
showStatusbooleantrue
sortbooleantrue
titlestring"lumen-web"
aria-labelstring-
classNamestring-

Dependencies#

npm

lucide-reactmotion

Built from

No other MiniDev files
All Developer tool UI components for React