Home

Awesome

React-Simple-ColorPicker

A simple(r) colorpicker written using React.

A fork of react-colorpicker, but with the extra stuff removed.

Why?

Install

Via npm:

npm install react-simple-colorpicker --save

Or if you want a UMD-compatible served from a CDN:

https://unpkg.com/react-simple-colorpicker/umd/index.js

Usage

var React = require("react");
var ReactDOM = require("react-dom");
var ColorPicker = require("react-simple-colorpicker");

var App = React.createClass({

  getInitialState : function() {
    return {
      color : this.props.initialColor
    };
  },

  render : function() {
    return (
      <ColorPicker color={this.state.color} onChange={this.handleChange} opacitySlider />
    );
  },

  handleChange : function(color) {
    console.log(color); // color is rgb(a) string
    this.setState({ color : color });
  }

});

ReactDOM.render(<App initialColor="rgb(0,0,0,1)" />, document.querySelector("#app"));

Changelog

1.4.2

v1.4.1

v1.4.0

v1.3.0

v1.2.0

v1.1.2

v1.1.1

v1.1.0 (deprecated)

v1.0.1

v1.0.0 (deprecated)

v0.5.0

v0.1.0