Skip to content
Look

Shared with the landing page. Theme is the select beside this menu.

FileTree

Open .md
Live preview

Loading example…

Expandable tree following the WAI-ARIA tree pattern: one tab stop with roving focus, arrows to move and open/close, Home/End, type-ahead, Enter or Space to select.

import { FileTree } from "@jcsoftdev/ui/containers";

Single-component entry points tree-shake to just this component: @jcsoftdev/ui/containers/file-tree.

<FileTree
nodes={nodes}
label="Archivos de la barbería"
defaultExpandedIds={["clientes"]}
defaultSelectedId="lista"
/>
Prop Type Default Description
nodes * FileTreeNode[]
label * string Accessible name of the tree.
selectedId string | null
defaultSelectedId string | null null
onSelect ((id: string, node: FileTreeNode) => void)
expandedIds string[]
defaultExpandedIds string[] []
onExpandedChange ((ids: string[]) => void)
className string
classNames Partial<Record<FileTreePart, string>> Per-part classes merged with cn; consumer classes win. className still targets the root and is merged last.

* marks a required prop.

packages/ui/src/containers/file-tree/file-tree.tsx