JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 388
  • Score
    100M100P100Q90162F
  • License ISC

A tiny Color Picker for React

Package Exports

  • coloreact

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (coloreact) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ColoReact

A tiny Color Picker for React

Install

$ npm i --save coloreact

How to use

  import { ColorPicker } from 'coloreact';

  // ...
  return (
    <ColorPicker
      opacity={true}
      color={this.state.currentColor}
      onChange={this.showColorNow}
      onComplete={this.showLastColor} />
    );
  // ...

Custom Parts

It is possible to create your own ColorPicker using Map and Sliders.

  import { Map, Slider } from 'coloreact';

  // ...
  return (
    <div className="myColorPicker">
      <Map
        x={this.state.saturation}
        y={this.state.value}
        max={100}
        backgroundColor={this.getHue()}
        onChange={this.handleSaturationAndValue}
      />
      <Slider
        vertical={true}
        value={this.state.hue}
        // type="hue"
        max={360}
        onChange={this.handleHue}
      />
    </div>  
  // ...