@bitfo/sanity-plugin-portable-table
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

sanity-plugin-portable-table

A table plugin for Sanity Studio v3 that supports Portable Text cells.

This plugin is inspired by the official @sanity/table plugin, but allows you to define a Portable Text configuration in your cells.

Installation

$ npm install --save @bitfo/sanity-plugin-portable-table

or

$ yarn add @bitfo/sanity-plugin-portable-table

Usage

Add it as a plugin in sanity.config.ts (or .js):

import {defineConfig} from 'sanity'
import {portableTable} from '@bitfo/sanity-plugin-portable-table'

export const defineConfig({
  ...
  plugins: [
    portableTable({
      // Optional: default name is "table"
      name: "my-table",

      // Optional: default title is "Table"
      title: "Portable Table",

      // Required: must provide a block definition
      cellSchema: {
        name: "my-block",
        type: "block",
        styles: [],
        lists: [],
        marks: {
          decorators: [{ title: "Strong", value: "strong" }],
          annotations: [],
        },
      },
    }),
  ]
})

License

Apache License 2.0 © Dave Lucia See LICENSE

Readme

Keywords

Package Sidebar

Install

npm i @bitfo/sanity-plugin-portable-table

Weekly Downloads

30

Version

1.0.2

License

Apache-2.0

Unpacked Size

73.4 kB

Total Files

24

Last publish

Collaborators

  • davydog187