Giter VIP home page Giter VIP logo

sanity-table's Introduction

Sanity Table Plugin

This is a Sanity Studio v3 plugin. For the v2 version, please refer to the v2 repository.

This is a (triple) fork of the Sanity Plugin Table, migrated to Sanity Studio V3. Only the v3 version is maintained by Sanity.io.

example

Acknowledgements

Big thanks to the original contributors for their work!

Disclaimer

Sometimes a table is just what you need. However, before using the Table plugin, consider if there are other ways to model your data that are:

  • easier to edit and validate
  • easier to query

Approaching your schemas in a more structured manner can often pay dividends down the line.

Install

Install using npm

$ npm i --save @sanity/table

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/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',
          },
        ],
      },
    ],
  },
});

License

MIT © ʞunp ʇɹǝdnɹ, Mathis Bullinger, Dave Lucia and Sanity.io

Develop & test

This plugin uses @sanity/plugin-kit with default configuration for build & watch scripts.

See Testing a plugin in Sanity Studio on how to run this plugin with hotreload in the studio.

Release new version

Run "CI & Release" workflow. Make sure to select the main branch and check "Release new version".

Semantic release will only release on configured branches, so it is safe to run release on any branch.

sanity-table's People

Contributors

danm72 avatar davydog187 avatar jonoroboto avatar kmelve avatar mathisbullinger avatar raffij avatar rdunk avatar semantic-release-bot avatar snorrees avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.