Latest Socket ResearchMalicious Chrome Extension Performs Hidden Affiliate Hijacking.Details
Socket
Book a DemoInstallSign in
Socket

c5-pick-color

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

c5-pick-color

Install:

latest
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

c5-pick-color

Install:

  npm install c5-pick-color

sample usage:

import ColorPicker from 'c5-pick-color';

const App = () => {
  const [color, setColor] = useState('#000000');
  const [showPicker, setShowPicker] = useState(false);

  return (
    <div>
      <button onClick={() => setShowPicker(!showPicker)}>Click me</button>
      {showPicker && (
        <ColorPicker color={color} onChange={(color) => setColor(color.hex)} />
      )}
    </div>
  );
};

I wanted to understand how to write a color picker component so I rewrote all the code from react-pick-color. This was a fun journey. I plan on making a few changed:

[ ] make modal wrapper around Picker so it will pop up where the mouse is

FAQs

Package last updated on 17 Jan 2022

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