1.0.6 • Published 9 years ago

react-colorpicker-updated v1.0.6

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

React-Simple-ColorPicker

A simple(r) colorpicker written using React.

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

Install

npm install react-simple-colorpicker --save

Usage

var React = require('react');
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} />
    );
  },

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

});

React.render(<App initialColor="#bada55" />, document.body);