Installation
npx shadcn@latest add @iconiq/file-treeProps
FileTree
Root provider for the compound file tree. Tracks expanded folders, hover highlight bounds, and shared visual settings.
defaultExpandedIdsstring[]Default []
highlightColorstringDefault #3b82f6
indentSizenumberDefault 24
showIconsbooleanDefault true
onNodeClick(nodeId: string) => voidonNodeExpand(nodeId: string, expanded: boolean) => voidclassNamestringchildrenReact.ReactNodeWrap `FileTreeList` and nested `FileTreeItem` components inside the root provider.
Hovering any row updates a single animated highlight that follows the active item inside the tree container.
FileTreeList
Semantic tree container for top-level and nested file rows. Supports Base UI `render` composition instead of Radix Slot.
classNamestringrenderReactElement | ((props) => ReactElement)FileTreeItem
Single file or folder row. Nested children render as an animated branch when the row is expandable.
nodeIdstringRequired
labelstringRequired
iconReact.ReactNodehasChildrenbooleanhighlightbooleanchildrenReact.ReactNodeFolder rows use Base UI Button for the toggle control while file rows remain static display rows.
Folder icons swap with a spring transition, and child lists animate open and closed with height and opacity motion.
Registry bundle
Install the exact registry entry shown on the right when you want the component file and its declared runtime dependencies together.
Dependencies: @base-ui/react, motion, lucide-react.
This page documents the Base UI install only. Folder and file rows use Base UI Button for toggles and selection.
The generated registry file is /r/file-tree.json.