🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

cf-component-color-picker

Package Overview
Dependencies
Maintainers
23
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cf-component-color-picker

A color picker wrapper for react-color

2.1.0
latest
npm
Version published
Weekly downloads
1
-88.89%
Maintainers
23
Weekly downloads
 
Created
Source

cf-component-color-picker

A color picker wrapper for react-color

Installation

Installation with yarn is recommended


$ yarn add cf-component-color-picker

Usage

import React from 'react';
import { ColorPicker, ColorPickerInput } from 'cf-component-color-picker';
import { createComponent } from 'cf-style-container';

const ConstrainingDiv = createComponent(
  () => ({
    width: '100px'
  }),
  'div'
);
ConstrainingDiv.setDisplayName('ConstrainingDiv');

class ColorPickerExample extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      color: 'green'
    };

    this.handleChange = this.handleChange.bind(this);
  }

  handleChange(e) {
    this.setState({ color: e.value });
  }

  render() {
    return (
      <div>
        <ColorPicker color={'#00BB77'} />
        <br />
        <ConstrainingDiv>
          <ColorPickerInput
            value={this.state.color}
            onChange={this.handleChange}
          />
        </ConstrainingDiv>
      </div>
    );
  }
}

export default ColorPickerExample;

FAQs

Package last updated on 08 May 2018

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