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.

Column

A database column object Column<TPlugin> consists of the common properties and the plugin-specific configuration.

Common Properties

PropTypeDescription
id*stringUnique identifier of the column.
name*stringName of the column.
iconIconDataDisplayed icon of the column.
widthstringWidth of the column.
descriptionstringDescription of the column.
wrappedbooleanWhether each cell in the column should be wrapped.
hiddenbooleanWhether the column is hidden.
isDeletedbooleanWhether the column is deleted.
isCountCappedbooleanWhether the count of the column should be capped.
countMethodCountMethodThe count method of the column.

Plugin Configuration

The plugin-specific configuration ColumnConfig<TPlugin> for the column.

PropTypeDescription
type*PluginType<TPlugins>Plugin type ID for the column.
config*InferConfig<TPlugin>Plugin-specific config for column.

ColumnDefs

ColumnDefs<TPlugins> is an array of column definitions Column<TPlugin> where the config property is 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

PropTypeDescription
id*stringUnique identifier of the row.
properties*Record<string, Cell<TPlugin>>The row data keyed by column ID.
iconIconDataDisplayed icon of the row.

Cell

A Cell<TPlugin> contains the id and value, where the value is determined by the plugin’s data type.

Common Properties

PropTypeDescription
id*stringUnique identifier of the cell.
value*InferData<TPlugin>Plugin-defined cell data.

Examples

Title Cell

// Cell<TitlePlugin>
{
  id: "e79a0b74-3aba-4149-9f74-0bb5791a6ee6",
  value: { value: "New title", icon: { type: "emoji", src: "📄" } },
}

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,
}

On this page