@gearbox-built/sanity-multi-reference
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

@gearbox-built/sanity-multi-reference

This is a Sanity Studio v3 plugin.

Installation

npm install @gearbox-built/sanity-multi-reference

or

yarn add @gearbox-built/sanity-multi-reference

Usage

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

import {defineConfig} from 'sanity'
import MultiReferencePlugin from '@gearbox-built/sanity-multi-reference'

export default defineConfig({
  //...
  plugins: [
    MultiReferencePlugin({
      apiVersion: import.meta.env.SANITY_STUDIO_API_VERSION, // Defaults to 2021-10-21
    }),
  ],
})

Schema

import {defineField} from 'sanity'


defineField({
  type: 'multiReference',
  name: 'multiReference',
  title: 'Multi Reference',
  options: {
    types: 'movie',
  },
}),

## Args

#### types

Accepts a single string or array of strings. This is the type of document you wish to reference.
eg:

options: { types: ['movie', 'castMember', 'post'], },


## License

[MIT](LICENSE) © Gearbox Built

## Develop & test

This plugin uses [@sanity/plugin-kit](https://github.com/sanity-io/plugin-kit)
with default configuration for build & watch scripts.

See [Testing a plugin in Sanity Studio](https://github.com/sanity-io/plugin-kit#testing-a-plugin-in-sanity-studio)
on how to run this plugin with hotreload in the studio.

Readme

Keywords

Package Sidebar

Install

npm i @gearbox-built/sanity-multi-reference

Weekly Downloads

22

Version

0.1.0

License

MIT

Unpacked Size

9.03 MB

Total Files

17

Last publish

Collaborators

  • jpotts77
  • nkndy
  • troymcginnis
  • devinedwards