Skip to content
This repository has been archived by the owner on Dec 23, 2022. It is now read-only.

Table schema type and input component for Sanity

License

Notifications You must be signed in to change notification settings

bitfo/sanity-plugin-table

 
 

Repository files navigation

DEPRECATED

This project has now been taken over by Sanity as an offical plugin

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.

example

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.

About

Table schema type and input component for Sanity

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 90.8%
  • JavaScript 9.2%