DataGrid
data
Callback fired when the filter changes
Terminal
$termuijs render data-grid
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
| Prop | Type | Required | Description |
|---|---|---|---|
columns | DataGridColumn[] | required | — |
rows | DataGridRow[] | required | — |
showHeader | boolean | optional | Whether to show the header row |
headerColor | Color | optional | Color for the header row |
stripe | boolean | optional | Whether rows are zebra-striped |
stripeColor | Color | optional | Stripe color |
separator | string | optional | Column separator character |
onSort | (key: string, direction: SortDirection) => void | optional | Callback fired when sort changes |
onFilter | (filter: string) => void | optional | Callback fired when the filter changes |