Database Properties
Database property objects are rendered in the Notion UI as database columns.
Database properties are represented as columns in the Notion database. They are defined by CellPlugin's that specify how the property behaves and renders in the Notion UI.
ColumnInfo
A database column object ColumnInfo<TPlugin> consists of the common properties and the plugin-specific configuration.
Common Properties
| Prop | Type | Description |
|---|---|---|
id* | string | Unique identifier of the column. |
name* | string | Name of the column. |
icon | IconData | Displayed icon of the column. |
width | string | Width of the column. |
description | string | Description of the column. |
wrapped | boolean | Whether each cell in the column should be wrapped. |
hidden | boolean | Whether the column is hidden. |
isDeleted | boolean | Whether the column is deleted. |
(deprecated) isCountCapped | boolean | Whether the count of the column should be capped. |
(deprecated) countMethod | CountMethod | The count method of the column. |
Plugin Configuration
The plugin-specific configuration ColumnConfig<TPlugin> for the column.
| Prop | Type | Description |
|---|---|---|
type* | TPlugin['id'] | Plugin type ID for the column. |
config* | InferConfig<TPlugin> | Plugin-specific config for column. |
ColumnDefs
A ColumnDefs is an array of column definitions ColumnInfo<TPlugin> where the config property may be optional.
const columnDefs: ColumnDefs = [
{
id: "col-1",
name: "Title",
type: "title",
// the `config` optional
config: { showIcon: true },
},
];Row
A Row<TPlugins> represents a row of data in the table.
API Reference
| Prop | Type | Description |
|---|---|---|
id* | string | Unique identifier of the row. |
properties* | Record<string, Cell<TPlugin>> | The row data keyed by column ID. |
icon | IconData | Displayed icon of the row. |
createdAt* | number | The row creation timestamp (in milliseconds). |
lastEditedAt* | number | The row last edited timestamp (in milliseconds). |
Cell
A Cell<TPlugin> contains the id and value, where the value is determined by the plugin’s data type.
Common Properties
| Prop | Type | Description |
|---|---|---|
id* | string | Unique identifier of the cell. |
value* | InferData<TPlugin> | Plugin-defined cell data. |
Examples
Title Cell
// Cell<TitlePlugin>
{
id: "e79a0b74-3aba-4149-9f74-0bb5791a6ee6",
value: "New title",
}Text Cell
// Cell<TextPlugin>
{
id: "e79a0b74-3aba-4149-9f74-0bb5791a6ee6",
value: "Some text..."
}Checkbox Cell
// Cell<CheckboxPlugin>
{
id: "e79a0b74-3aba-4149-9f74-0bb5791a6ee6",
value: true,
}CoverImage
A CoverImage object contains information about the cover image. It is used to represent a cover that is rendered as a page cover in the Notion UI.
IconData
An IconData object contains information about an icon. It is most often used to represent an icon that is rendered as a page icon in the Notion UI.