Socket
Socket
Sign inDemoInstall

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


Version published
Weekly downloads
42
increased by740%
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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc