Docs
Tree View

Tree View

The Tree View component displays hierarchical data in a collapsible format, resembling a tree structure. Users navigate through parent-child relationships with visual cues, expanding or collapsing nodes to reveal or hide detail. Used in file explorers or organizational charts, it enhances productivity by providing an intuitive interface for managing complex data.

Installation

yarn add @camped-ui/tree-view

Usage

import { TreeView } from "@camped-ui/tree-view";
 <TreeView
    elements={elements}
    className="h-60"
    initialExpendedItems={["2"]}
    initialSelectedId="21" 
  />

Examples

Default

With Build-in select

With Build-in expand