Skip to content
Branch: master
Clone or download
Latest commit 8c9d0b3 May 24, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src sync May 24, 2019
.gitignore 2.0 Mar 15, 2019
.travis.yml sync Apr 16, 2019
CHANGELOG.md 2.0 Mar 15, 2019
README.md sync May 16, 2019
babel.config.js sync May 15, 2019
index.d.ts sync Apr 16, 2019
package.json sync May 24, 2019
rollup.config.js
screenshot.png update screenshot Aug 7, 2015
yarn.lock sync May 24, 2019

README.md

react-input-color

npm npm Build Status codecov styled with prettier

React input color component with hsv color picker

The color picker is inspired by the sketch color picker

screenshot

Starting from v2, this component is rewritten with emotion and it doesnot require any external css file.

Installation

npm install react-input-color --save
yarn add react-input-color

Demo

https://swiftcarrot.dev/react-input-color

Usage

import React from 'react';
import InputColor from 'react-input-color';

function App() {
  const [color, setColor] = React.useState({});

  return (
    <div>
      <InputColor
        initialHexColor="#5e72e4"
        onChange={setColor}
        placement="right"
      />
      <div
        style={{
          width: 50,
          height: 50,
          marginTop: 20,
          backgroundColor: color.hex
        }}
      />
    </div>
  );
}

License

MIT

You can’t perform that action at this time.