@bitfo/sanity-plugin-table
v3.0.0
Published
Table schema type and input component for Sanity CMS
Downloads
2
Readme
Sanity Table 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
Install using npm
$ npm i sanity-plugin-table@v3
Usage
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',
},
],
},
],
},
});
Development
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.