Skip to content

A table plugin for Sanity that supports Portable Text cells

License

Notifications You must be signed in to change notification settings

WhimsicalCode/sanity-portable-table

This branch is 1 commit ahead of davydog187/sanity-portable-table:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

dba7c3f · Oct 24, 2024

History

21 Commits
Feb 5, 2023
Oct 24, 2024
Feb 25, 2024
Feb 5, 2023
Feb 5, 2023
Feb 5, 2023
Oct 24, 2024
Feb 5, 2023
Feb 5, 2023
Oct 24, 2024
Feb 5, 2023
Mar 23, 2024
Feb 5, 2023
Feb 5, 2023
Feb 5, 2023
Feb 25, 2024

Repository files navigation

Fork info

An attempt to fix Error: Cannot resolve a DOM node from Slate node when using plugin with default config.


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

About

A table plugin for Sanity that supports Portable Text cells

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 50.0%
  • JavaScript 50.0%