Table View
An editable collection of rows with typed properties, filters, sorting, and multiple layouts.
Table View Uncontrolled
Installation
pnpm add @notion-kit/table-viewUsage
Define the properties, then add rows keyed by property ID. Include one title
property to label rows across layouts.
import { TableView } from "@notion-kit/table-view";
const now = Date.now();
export function Tasks() {
return (
<TableView
defaultProperties={[
{ id: "name", name: "Task", type: "title" },
{ id: "done", name: "Done", type: "checkbox" },
]}
defaultData={[
{
id: "task-1",
createdAt: now,
lastEditedAt: now,
properties: {
name: { id: "task-1-name", value: "Review the design" },
done: { id: "task-1-done", value: false },
},
},
]}
/>
);
}Use View Settings to switch between Table, List, Board, Timeline, Calendar, and Map. Use the toolbar to search, filter, sort, and group rows. Select rows to edit them in bulk, or open a row to edit its properties.
Examples
Controlled table
Pass the current value and a change callback for each resource you own. The callback includes the next value and the action that produced it.
Table View Controlled
<TableView
data={rows}
onDataChange={({ next }) => setRows(next)}
properties={properties}
onPropertiesChange={({ next }) => setProperties(next)}
/>Rows, properties, and view settings can each be controlled independently. Choose a mode for each resource when the component mounts.
| Resource | Initial value | Controlled value | Change callback |
|---|---|---|---|
| Rows | defaultData | data | onDataChange |
| Properties | defaultProperties | properties | onPropertiesChange |
| View settings | defaultView | view | onViewChange |
Calendar layout
Set layout: "calendar" and point dateView.datePropertyId to a Date property.
Layouts covers all six layouts and includes an
interactive Calendar example.
Edit logs
Pass edit log callbacks to show paginated table and row history.
Guides
Database
Switch between named views that share rows and properties.
Create a cell plugin
Add a custom property type and its editor.
Migrate Timeline settings
Use the Timeline migration guide
to update persisted settings to view.dateView.
API reference
TableView
Prop
Type
TableViewState
view and defaultView accept PartialTableViewState, including partial
dateView and mapView settings. Use createTableViewState(layout) when you
need a complete initial state, such as for a Database view.
Prop
Type