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

replace-react-color

v4.1.3

Published

A Collection of Color Pickers from Sketch, Photoshop, Chrome & more

Downloads

940

Readme

replace-react-color

A modernized, lightweight, and dependency-free TypeScript fork of the highly popular legacy react-color library.

This repository brings the classic color pickers (Sketch, Photoshop, Chrome, etc.) into the modern era, fully compatible with React 19, while completely eliminating legacy bloat and ensuring long-term maintainability.

🎨 Try the Live Demo — All pickers, fully interactive. Compare side-by-side with the original react-color.

📚 View the API Documentation

Demo

🏆 Acknowledgements & Credits

  • Modernization & Refactor: Spearheaded by felipecarrillo100, who completely overhauled the codebase to modern standards, purged legacy dependencies, implemented native TypeScript utilities, and modernized the build infrastructure to Vite/esbuild.
  • Original Author: The original react-color library was brilliantly designed and created by Case Sandberg (@casesandberg). All credit for the iconic UI designs, component structures, and the original reactCSS paradigm goes to him.

🚀 What's New in Version 4.0

Version 4.0 marks a significant milestone in the evolution of this fork, moving from a "modernized wrapper" to a completely rebuilt internal architecture.

  • Zero External Dependencies: We have completely eliminated the final production dependency (tinycolor2) and replaced it with a custom, high-precision internal color engine.
  • Zero Styling Dependencies: We have completely removed the reactCSS engine. Styles are now handled via native React inline styles, making the library even lighter and faster.
  • Standard Styling Props: Every picker now supports standard className and style props out of the box.
  • Performance Boost: Interactions (like dragging pointers) are significantly more fluid due to the removal of the legacy styling abstraction layer.
  • Full Type Safety: Rebuilt internal types to ensure that custom sub-component styling is robust and type-safe.

🧠 Rationale for the Rewrite

The original react-color library was a staple in the React ecosystem but suffered from significant bit-rot:

  1. Dependency Bloat: It relied heavily on outdated utilities like lodash, lodash-es, and @icons/material.
  2. React 15/16 Legacy: The codebase was written using outdated React Class components, legacy lifecycle methods, and Enzyme testing paradigms, breaking entirely on modern React.
  3. reactcss Abandonment: The underlying styling engine (reactcss) was unmaintained, throwing numerous deprecation warnings and causing performance bottlenecks.
  4. TypeScript Deficiencies: It lacked native TypeScript support, relying on clunky third-party @types.

What We Fixed:

  • Reduced Dependencies: Eliminated lodash, material-colors, and external icon libraries.
  • Inlined Assets: SVGs and standard color palettes are now natively built-in.
  • Native Styling: Completely replaced the reactcss engine with pure React inline styles, ensuring zero overhead and better performance.
  • Hooks & Functional Components: Completely rewrote the core library to use modern React Hooks, ensuring 100% compatibility with React 19 and Strict Mode.
  • Highly Optimized Build: Modernized the build pipeline using tsup to output optimized ESM and CommonJS bundles.

📖 Installation & Usage

Basic Example

import React, { useState } from 'react'
import { SketchPicker } from 'replace-react-color'

export const Component = () => {
  const [color, setColor] = useState('#fff')

  return (
    <SketchPicker 
      color={color} 
      onChangeComplete={(newColor) => setColor(newColor.hex)} 
    />
  )
}

🎨 Styling (New in v4.0)

You can now style any picker using standard React props:

<ChromePicker 
  className="my-custom-picker"
  style={{ boxShadow: 'none', border: '1px solid #eee' }}
/>

[!NOTE] The legacy styles prop (from the original react-color) is still supported for backward compatibility but is now considered deprecated. We recommend migrating to the standard style and className props.


🚀 Migration Plan (For Existing Users)

Migrating from the legacy react-color is a seamless, drop-in replacement.

1. Update Dependencies

npm uninstall react-color @types/react-color
npm install replace-react-color

2. Update Imports

// OLD: import { SketchPicker } from 'react-color'
// NEW:
import { SketchPicker } from 'replace-react-color'

3. Enjoy Modern Performance

You no longer need to use --legacy-peer-deps or worry about console flooding with deprecation warnings. You can now safely upgrade your application to React 18 or React 19!


🛠 Available Pickers

You can import AlphaPicker, BlockPicker, ChromePicker, CirclePicker, CompactPicker, GithubPicker, HuePicker, MaterialPicker, PhotoshopPicker, SketchPicker, SliderPicker, SwatchesPicker, and TwitterPicker.