File Tree

Composable file and folder primitives with springing branches, a gliding selection, and complete keyboard navigation.

Preview

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @beui/file-tree

API Reference

FileTreeFolder

value
string
—
name
string
—
icon?
ReactNode
—
disabled?
boolean
—
className?
string
—

FileTreeFile

value
string
—
name
string
—
icon?
ReactNode
—
disabled?
boolean
—
className?
string
—

FileTree

value?
string | null
—
defaultValue?
string | null
null
onValueChange?
((value: string) => void)
—
expandedIds?
string[]
—
defaultExpandedIds?
string[]
[]
onExpandedChange?
((expandedIds: string[]) => void)
—
ariaLabel?
string
Files
indent?
number
18
className?
string
—
classNames?
FileTreeClassNames
—

Updated