Table View
An composable, editable data table.
Supported Features
-
Controlled/Uncontrolled state management
-
Column actions: CRUD, DND, duplicating
-
Row actions: CRUD, DND, duplicating
-
Column wrapping
-
Column pinning
-
Column type changing
-
Table: sorting, grouping
-
Cells plugins
- Required plugins:
title,text - Selectable:
checkbox,select,multi-select - Numeric inputs:
number - External links:
email,phone,url - Date & time:
date,created-time,last-edited-time
- Required plugins:
Installation
Note
-
- Every table should have at least two plugins:
title()andtext()
- Every table should have at least two plugins:
-
- Every table should have exactly one
titleproperty.
- Every table should have exactly one
Examples
Uncontrolled Table
Controlled Table
API Reference
TableView
A TableView is a generic component TableView<TPlugins> where TPlugins extends CellPlugin[].
It provides a table view with editable cells and supports various plugins for cell types.
| Prop | Type | Description |
|---|---|---|
plugins | TPlugins | The plugins to use for the table. Each table should contain at least title() and text() plugins. |
properties* | ColumnDefs<TPlugins> | The column definitions of the table. |
data* | Row<TPlugins>[] | The rows of the table. |
onDataChange | OnChangeFn<Row<TPlugins>[]> | Callback function that is called when the table data changes. |
onPropertiesChange | OnChangeFn<ColumnDefs<TPlugins>> | Callback function that is called when the table properties change. |
type TableState
A TableState is a generic type TableState<TPlugins> that represents the state of a table, including its column definitions and row data.
| Prop | Type | Default | Description |
|---|---|---|---|
properties* | ColumnDefs<TPlugins> | - | The column definitions of the table. |
data* | Row<TPlugins>[] | - | The rows of the table. |