项目作者: LoicMahieu

项目描述 :
component for material-ui
高级语言: JavaScript
项目地址: git://github.com/LoicMahieu/material-ui-color-picker.git
创建时间: 2017-03-22T12:02:29Z
项目社区:https://github.com/LoicMahieu/material-ui-color-picker

开源协议:MIT License

下载


<ColorPicker> for material-ui

`<ColorPicker>` example

ColorPicker based on <TextField ></TextField> and <ChromePicker ></ChromePicker> from react-color and its redux-form field component.

Demo

https://material-ui-color-picker.now.sh/

Installation

For material-ui (v1):

  1. npm install --save material-ui-color-picker

Usage

  1. import React from 'react'
  2. import ColorPicker from 'material-ui-color-picker'
  3. <ColorPicker
  4. name='color'
  5. defaultValue='#000'
  6. // value={this.state.color} - for controlled component
  7. onChange={color => console.log(color)}
  8. />

Redux-form field

  1. import React, { Component } from 'react';
  2. import { reduxForm, Field } from 'redux-form';
  3. import { ColorPickerField } from 'material-ui-color-picker';
  4. ...
  5. <Field
  6. name="color"
  7. component={ColorPickerField}
  8. ></Field>
  9. ...

There is not so much properties at this time. The was very quickly designed for my needs. Feel free to submit a PR with new features ;)

License

This library is licensed under the MIT Licence, and sponsored by iGLOO.