0.2.0 • Published 3 years ago

rsuite-color-picker v0.2.0

Weekly downloads
20
License
MIT
Repository
github
Last release
3 years ago

rsuite-color-picker

Package a color picker extension that can select color for rsuite.

Examples

DEMO

Installation

npm install rsuite-color-picker --save

or

yarn add rsuite-color-picker

Usage

import ColorPicker from 'rsuite-color-picker'
import 'rsuite-color-picker/lib/styles.less'
// import 'rsuite-color-picker/lib/styles.css'

const App = () => <ColorPicker />

ReactDOM.render(<App />, mountNode)

Props

PropertyType(Default)Description
disabledboolean(false)disabled
valueString/Objectvalue (Controlled)
defaultValueString/Object(#00bcd4)Default value
disableAlphaboolean(false)Remove alpha slider and options from picker
onChangeFunctioncall every time the color is changed
onChangeCompleteFunctioncall once a color change is complete

see detail of 4 props in React Color:

  1. color (value / defaultValue)
  2. disableAlpha (disableAlpha)
  3. onChange (onChange)
  4. onChangeComplete (onChangeComplete)

Less variable

  • @color-picker-wrapper-padding: 5px;
  • @color-picker-border-radius: 6px;

License

MIT licensed