New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

reactcolorpicker

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reactcolorpicker

A light and simple color picker for react

latest
Source
npmnpm
Version
0.0.5
Version published
Weekly downloads
1
-75%
Maintainers
1
Weekly downloads
 
Created
Source

reactColorPicker

A light and simple color picker for react.

Installation

npm install reactColorPicker --save or yarn add reactColorPicker

Usage

import React from 'react';
import Picker from 'reactcolorpicker';

class MyComponent extends React.Component {
    constructor(props) {
        super(props);
        this.setColor = this.setColor.bind(this);
        this.state = {
            RGB: [0, 0, 0],
            HSL: [360, 1, 0],
            HEX: '#000'
        }
    }
    
    // Execute this method every time a color is picked
    setColor(color) {
        this.setState({
            RGB: [color.R, color.G, color.B],
            HSL: [color.H, color.S, color.L],
            HEX: color.HEX
        });
        console.log('Color updated!')
    }
    
    render() {return(
        <div>
            <h2 style={{color: this.state.HEX}}>
                Please pick your color:
            </h2>
            <Picker getValue={this.setColor}/>
        </div>
    )}
}

Keywords

react

FAQs

Package last updated on 21 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts