Skip to content

Tree

widgetsdisplay

Tree: a collapsible tree widget for displaying hierarchical data

Installation

$ bunx termuijs add tree

Copies the source into src/components/tree/ and installs @termuijs/core, @termuijs/widgets.

Usage

ts
import { Tree } from '@termuijs/widgets'
ts
new Tree(options: TreeOptions, style: Partial<Style> = {})

API Reference

Tree

PropTypeRequiredDescription
nodesTreeNode[]required
onSelect(node: TreeNode, path: number[]) => voidoptional
indentnumberoptional
#display#tree