This project has now been taken over by Sanity as an offical plugin
This is a (double) fork of the Sanity Plugin Table, migrated to Sanity Studio V3.
Forked form rdunk/sanity-plugin-table. Forked form MathisBullinger/sanity-plugin-another-table.
Install using npm
$ npm i sanity-plugin-table@v3
Add the plugin to your project configuration. Then use the type in your schemas
// sanity.config.ts
import { defineConfig } from 'sanity';
import { table } from 'sanity-plugin-table';
export default defineConfig({
name: 'default',
title: 'My Cool Project',
projectId: 'my-project-id',
dataset: 'production',
plugins: [
// Include the table plugin
table(),
],
schema: {
types: [
{
name: 'product',
title: 'Product',
type: 'document',
fields: [
{
// Include the table as a field
// Giving it a semantic title
name: 'sizeChart',
title: 'Size Chart',
type: 'table',
},
],
},
],
},
});
The project can be built using npm run build
.
To test the plugin in a Sanity project, run npm run link-watch
, then sanity-plugin-table
can be tested inside the Sanity Studio. Follow the directions in plugin-kit for more details.