Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sanity-plugin-user-select-input

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sanity-plugin-user-select-input

Select a User ID from the Project's User Store

  • 1.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
191
increased by11.7%
Maintainers
1
Weekly downloads
 
Created
Source

sanity-plugin-user-select-input

Custom Input for selecting a User from the Project and storing the ID as a string.

Searching and selecting a Project User

Note: Think of the string like a weak reference. Users can be removed from the Project without first checking if their ID is used in any Document. And once removed their ID will remain stored as the field value.

This is not a replacement for creating your own schema for example staff, author, profile, person etc but rather useful for linking a Document to a Project User. For example brief, task, reviewer etc

Installation

sanity install user-select-input

You have two options:

Fast: Import a helper function and customise the field's name

import { userSelectField } from "sanity-plugin-user-select-input";

export default {
  // ... all other schema details
  fields: [
    // ... all other fields
    userSelectField("reviewer"),
  ],
};

Customisable: Import just the Component to use in your own field:

import UserSelectInput from "sanity-plugin-user-select-input";

export default {
  // ... all other schema details
  fields: [
    // ... all other fields
    {
      name: "reviewer",
      title: "Task Reviewer",
      description: "Select a User",
      type: "string",
      inputComponent: UserSelectInput,
    },
  ],
};

License

MIT © Simeon Griggs See LICENSE

Keywords

FAQs

Package last updated on 11 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc