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

react-studio-color-picker

v2.0.0

Published

Mozilla-style React color picker with SV plane, hue/alpha sliders, RGBA inputs, and swatches.

Downloads

309

Readme

react-studio-color-picker

Latest: 2.0.0 — version alignment with [email protected] (no API changes). See CHANGELOG.md.

Mozilla DevTools–style React color picker: saturation/value plane, hue and alpha sliders, RGBA inputs, eyedropper, and preset swatches.

npm License: MIT

Used by react-email-studio for inspector color fields. Standalone — use it in any React app.

Install

npm install react-studio-color-picker lucide-react

Peer dependencies: react, react-dom, lucide-react.

Usage

Color input (swatch + hex field + popover)

import { useState } from "react";
import { ColorInput, DEFAULT_COLOR_PICKER_THEME } from "react-studio-color-picker";

export function Example() {
  const [color, setColor] = useState("#6366f1");

  return (
    <ColorInput
      value={color}
      onChange={setColor}
      theme={DEFAULT_COLOR_PICKER_THEME}
      placeholder="transparent"
      allowTransparent
      allowAlpha
    />
  );
}

Inline picker panel

import { ColorPicker } from "react-studio-color-picker";

<ColorPicker
  value="#ef4444"
  onChange={setColor}
  width={260}
  showEyedropper
  showSwatches
/>

Popover only (custom trigger)

import { useRef, useState } from "react";
import { ColorPickerPopover } from "react-studio-color-picker";

function CustomTrigger() {
  const [open, setOpen] = useState(false);
  const [color, setColor] = useState("#6366f1");
  const btnRef = useRef<HTMLButtonElement>(null);

  return (
    <>
      <button ref={btnRef} type="button" onClick={() => setOpen(true)}>
        Pick color
      </button>
      {open && (
        <ColorPickerPopover
          value={color}
          onChange={setColor}
          anchorEl={btnRef.current}
          onClose={() => setOpen(false)}
        />
      )}
    </>
  );
}

Public API

Components

| Export | Description | |--------|-------------| | ColorPicker | Inline picker panel (no positioning) | | ColorInput | Swatch + hex input + popover | | InspectorColorInput | Alias for ColorInput | | ColorPickerPopover | Anchored popover panel | | ColorSwatchGrid | Preset swatch grid |

Constants & utilities

| Export | Description | |--------|-------------| | DEFAULT_COLOR_PICKER_THEME | Light theme tokens | | DEFAULT_SWATCHES | 16 preset hex colors | | TRANSPARENT_COLOR / TRANSPARENT | "" sentinel for transparent | | parseCssColor, formatCssColor | Parse/format #hex and rgba() | | hexToRgb, rgbToHex, rgbToHsv, hsvToRgb | Color space helpers | | isHexColor | Hex string validator |

Types

ColorPickerTheme, ColorPickerProps, ColorInputProps, ColorPickerPopoverProps, ColorSwatchGridProps, ColorPickerBaseProps, Rgba

Props reference

Shared (ColorPicker, ColorInput, ColorPickerPopover)

| Prop | Type | Default | Description | |------|------|---------|-------------| | value | string | — | #hex, rgba(...), or "" for transparent | | onChange | (color: string) => void | required | Called on every change | | theme | ColorPickerTheme | light theme | Border, accent, surface tokens | | allowTransparent | boolean | true | Allow "" / transparent swatch | | allowAlpha | boolean | true* | Alpha slider + A input | | fallbackColor | string | #ffffff | Used when transparent disabled | | swatches | string[] | 16 presets | Custom swatch colors | | showSwatches | boolean | true | Preset grid | | showEyedropper | boolean | true | Browser eyedropper button |

* allowAlpha defaults to true when allowTransparent is enabled on ColorInput.

ColorPicker only

| Prop | Type | Default | |------|------|---------| | width | number | 240 | | className | string | — | | style | CSSProperties | — |

ColorInput only

| Prop | Type | Default | |------|------|---------| | placeholder | string | — | | emptyAsTransparent | boolean | false | | hexInputWidth | number | 120 | | disabled | boolean | false | | triggerLabel | string | Open color picker |

ColorPickerPopover only

| Prop | Type | Default | |------|------|---------| | anchorEl | HTMLElement \| null | required | | onClose | () => void | — | | width | number | 240 |

ColorPickerTheme

type ColorPickerTheme = {
  border: string;
  accent: string;
  text?: string;
  surface?: string;
  inputBg?: string;
  muted?: string;
};

Publish

From the monorepo root:

pnpm publish:all              # test → build → publish all packages
pnpm publish:all:dry-run      # verify tarball without uploading

See DEPLOYMENT.md. Publish react-studio-color-picker before react-email-studio (order is handled automatically).

License

MIT