Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/davydog187/sanity-portable-table
A table plugin for Sanity that supports Portable Text cells
https://github.com/davydog187/sanity-portable-table
plugin react sanity typescript
Last synced: 10 days ago
JSON representation
A table plugin for Sanity that supports Portable Text cells
- Host: GitHub
- URL: https://github.com/davydog187/sanity-portable-table
- Owner: davydog187
- License: apache-2.0
- Created: 2023-02-05T17:56:10.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-23T13:26:34.000Z (8 months ago)
- Last Synced: 2024-10-16T08:32:41.730Z (22 days ago)
- Topics: plugin, react, sanity, typescript
- Language: TypeScript
- Homepage:
- Size: 1.07 MB
- Stars: 10
- Watchers: 2
- Forks: 8
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sanity-plugin-portable-table
A table plugin for [Sanity Studio v3]() that supports [Portable Text](https://www.sanity.io/docs/presenting-block-text) cells.
This plugin is inspired by the official [@sanity/table](https://github.com/sanity-io/table) plugin, but allows you to define a Portable Text configuration in your cells.
## Installation
```bash
$ npm install --save @bitfo/sanity-plugin-portable-table
```or
```bash
$ yarn add @bitfo/sanity-plugin-portable-table
```## Usage
Add it as a plugin in sanity.config.ts (or .js):
```typescript
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