0.1.6 • Published 4 years ago

@hhsdev/react-color-picker v0.1.6

Weekly downloads
6
License
MIT
Repository
-
Last release
4 years ago

React-Color-Picker

A color picking tool for your react projects.

This is a project I dumped out in a coffee-fueled weekend. If you want more feature-complete color pickers, I'd recommend @casesandberg's React Color.

Demo

Demo

Getting started

Prerequisites

React.

Installing

$ npm install @hhsdev/react-color-picker --save

Usage

import React from "react";
import ColorPicker from "@hhsdev/react-color-picker";

class Component extends React.Component {
  constructor(props) {
    super(props);
  }

  render() {
    return (
      <div
        ref={div => (this.div = div)}
        style={{
          padding: 24
        }}
      >
        <ColorPicker
          callback={color =>
            (this.div.style.background = `rgb(${color.r}, ${color.g}, ${color.b})`)
          }
        />
      </div>
    );
  }
}

Documentation

Coming soon!

License

This project is licensed under the MIT License - see the LICENSE.md file for details