43 Pro components and page blocks

Get Pro

Tree View

New

Preview

Customize

Indent16px

Usage

import { TreeView } from "@/components/uibrik/tree-view/tree-view";

<TreeView data={data} />

Installation

npx shadcn@latest add https://uibrik.com/r/tree-view.json
Adds the files to components/uibrik/tree-view and installs @tabler/icons-react and motion. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/tree-view.

Props

TreeView
guides
Type boolean
true
Vertical lines linking children to their folder.
indent
Type number
16
Indent per level.
datarequired
Type { name; children?; icon? }[]
–
The tree. A node with children (even empty) is a folder; icons come from the file extension unless given.
defaultExpanded
Type string[] | "all"
–
Folder paths open at first, like "src/app".
defaultSelected
Type string
–
Path selected at first.
onSelect
Type (path, node) => void
–
Called when a row is selected.
label
Type string
"Files"
Accessible name for the tree.
className
Type string
–
Classes for the tree.