npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

sanity-plugin-color-input

v1.1.0

Published

Professional color picker with gradient support for Sanity Studio v3, v4, and v5

Readme

sanity-plugin-color-input

A beautifully designed, highly customizable color picker plugin for Sanity Studio v3, v4, and v5.

Features

  • 🎨 Visual Color Picker: A stunning visual interface to pick any color.
  • 🌈 Gradient Support: Toggle between solid colors and gorgeous linear gradients.
  • 💅 Rich Return Format: Provides HEX, RGBA, and HSL for solids, plus full CSS linear-gradient strings for gradients.
  • Customizable Color Presets: Use our meticulously crafted predefined presets or provide your own custom branded colors via options.
  • 📋 One-Click Copy: Easily copy HEX, RGBA, HSL, and CSS Gradient values to clipboard.
  • 🚀 Built for Sanity: Fully compatible with Sanity Studio v3, v4, and v5 architecture.

Installation

# Using npm
npm install sanity-plugin-color-input

# Using yarn
yarn add sanity-plugin-color-input

# Using pnpm
pnpm add sanity-plugin-color-input

Setup & Usage

Compatible with Node.js 18, 20, 22, and 24.

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

import {defineConfig} from 'sanity'
import {customColorPicker} from 'sanity-plugin-color-input'

export default defineConfig({
  // ...other config settings
  plugins: [
    // Add the plugin here
    customColorPicker(),
  ],
})

Schema Usage

Now you can use the color type in your schemas.

export default {
  name: 'myDocument',
  title: 'My Document',
  type: 'document',
  fields: [
    {
      name: 'brandColor',
      title: 'Brand Color',
      type: 'color',
    },
  ],
}

Customizing the Preset Colors

You can easily override the default color presets by providing your own colors array in your field's options:

export default {
  name: 'myDocument',
  title: 'My Document',
  type: 'document',
  fields: [
    {
      name: 'brandColor',
      title: 'Brand Color',
      type: 'color',
      options: {
        // This will override the default presets, useful for restricting choices
        // to brand-specific color palettes.
        colors: [
          // Solid color presets
          '#1A1A1A',
          '#F5F5F5',
          // Gradient preset
          {hex: '#E91E63', hex2: '#2196F3', angle: 45},
        ],
      },
    },
  ],
}

Data Structure

The color field returns a solid color by default, or a gradient if selected:

{
  "_type": "color",
  "hex": "#f44336",
  "rgba": "rgba(244, 67, 54, 1)",
  "hsl": "hsl(4, 90%, 58%)",
  "isGradient": true,
  "hex2": "#000000",
  "angle": 180,
  "css": "linear-gradient(180deg, #f44336, #000000)"
}

License

MIT © Code-Journey