How AI is powering better personalization in e-commerce [with Vercel]. Sign up now

Table

Studio v2
This plugin only works with an older version of Sanity Studio (v2), which is deprecated.

Basic table support

By ʞunp ʇɹǝdnɹ

v2 install command (deprecated)

yarn add sanity-plugin-table@studio-v2

v2 install command (deprecated)

sanity install table

Sanity Plugin Table

NPM version NPM downloads GitHub Release Date License

Sanity plugin that implements a table schema type and input component.



Notice: Version 2.x of this plugin includes a breaking change, see the Configuration section to migrate existing data.


example

Install

Install using the Sanity CLI.

$ sanity install table

Usage

Simply specify table as a field type in your schema.

export default {
  name: 'product',
  title: 'Product',
  type: 'document',
  fields: [
    {
      name: 'sizeChart',
      title: 'Size Chart',
      type: 'table', // Specify 'table' type
    },
  ],
};

Configuration

You can create a configuration file to provide the _type used for table row data. This is especially useful if you are upgrading or have existing data, as version 2.x of this plugin uses tableRow by default, replacing row used in version 1.x.

In your studio, create a config/table.json file (relative to the root directory). The rowType string value can be whatever you like. Use row if you are migrating existing data from version 1 to 2.

{
  "rowType": "row"
}

License

MIT

Related contributions