Skip to content

DataGrid

widgetsdata

Callback fired when the filter changes

Installation

$ bunx termuijs add data-grid

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

Usage

ts
import { DataGrid } from '@termuijs/widgets'
ts
new DataGrid(columns: DataGridColumn[], rows: DataGridRow[], style: Partial<Style> = {}, options: DataGridOptions = {},)

API Reference

DataGrid

PropTypeRequiredDescription
columnsDataGridColumn[]required
rowsDataGridRow[]required
showHeaderbooleanoptionalWhether to show the header row
headerColorColoroptionalColor for the header row
stripebooleanoptionalWhether rows are zebra-striped
stripeColorColoroptionalStripe color
separatorstringoptionalColumn separator character
onSort(key: string, direction: SortDirection) => voidoptionalCallback fired when sort changes
onFilter(filter: string) => voidoptionalCallback fired when the filter changes
#data#data-grid