Skip to content

TreeTable

widgetsdata

TreeTable: combines Tree expand/collapse with Table columns

Installation

$ bunx termuijs add tree-table

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

Usage

ts
import { TreeTable } from '@termuijs/widgets'
ts
new TreeTable(columns: TreeTableColumn[], rows: TreeTableRow[], style: Partial<Style> = {}, options: TreeTableOptions = {},)

API Reference

TreeTable

PropTypeRequiredDescription
columnsTreeTableColumn[]required
rowsTreeTableRow[]required
showHeaderbooleanoptionalWhether to show the header row
headerColorColoroptionalColor for the header row
stripebooleanoptionalWhether rows are zebra-striped
stripeColorColoroptionalStripe color
separatorstringoptionalColumn separator character
indentnumberoptionalIndentation per depth (default 2)
onSelect(row: TreeTableRow) => voidoptionalCallback when a row is selected
#data#tree-table