Tree View

Hierarchical list with expand/collapse. Supports icons, badges, and keyboard navigation.

import{ TreeView } from "@pepulux/ui"

Default

Compact (sm)

Props

PropTypeDefaultDescription
nodes*TreeNode[]Array of { id, label, children?, icon?, badge? }
selectedIdstringControlled selected node id
onSelect(node: TreeNode) => voidCalled when a node is clicked
defaultExpandedstring[]IDs of nodes expanded on initial render
size"sm" | "md""md"Row height and font size