Skip to content

Table

widgetsdata

Table: renders tabular data with columns, headers, and optional zebra-striping

Installation

$ bunx termuijs add table

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

Usage

ts
import { Table } from '@termuijs/widgets'
ts
new Table(columnsOrProps: TableColumn[] | TableProps, rows: TableRow[] = [], style: Partial<Style> = {}, options: TableOptions = {},)

API Reference

Table

PropTypeRequiredDescription
columnsTableColumn[]required
rowsTableRow[]optional
stylePartial<Style>optional
optionsTableOptionsoptional
stateTableStateoptionalExternal state object – if provided, Table syncs rows through it
onStateChange(state: TableState) => voidoptionalCalled whenever rows change via setRows
#data#table