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
-
Table Views: Table, List, Board
-
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:
-
Open row as: center dialog, side peek, or full page
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. |
table | Partial<TableGlobalState> | The global state 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. |
onTableChange | OnChangeFn<TableGlobalState> | Callback function that is called when the table global state changes. |
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. |
type TableGlobalState
| Prop | Type | Default | Description |
|---|---|---|---|
layout | "table" | "list" | "board" | "table" | The layout view of the table. |
locked | boolean | false | Whether the table is locked (non-editable). |
rowView | "center" | "side" | "full" | "side" | The view type of the opened row. |
openedRowId | string | null | null | The unique identifier of the opened row. |