1.0.0 • Published 4 years ago
@jswork/react-ant-color-picker v1.0.0
react-ant-color-picker
Color picker for ant project.
installation
npm install -S @jswork/react-ant-color-picker
properties
Name | Type | Required | Default | Description |
---|---|---|---|---|
className | string | false | - | The extended className for component. |
label | string | false | 'Select' | The select label text. |
value | string | false | '#FFFFFF' | The runtime color. |
onChange | func | false | noop | The handler when value chnage. |
placement | string | false | 'bottom' | The placement for popover. |
usage
import css
@import "~@jswork/react-ant-color-picker/dist/style.css"; // or use sass @import "~@jswork/react-ant-color-picker/dist/style.scss"; // customize your styles: $react-ant-color-picker-options: ()
import js
import ReactDemokit from '@jswork/react-demokit'; import React from 'react'; import ReactDOM from 'react-dom'; import ReactAntColorPicker from '@jswork/react-ant-color-picker'; import './assets/style.scss'; class App extends React.Component { state = { value: '#282c34' }; onChange = (inEvent) => { const { value } = inEvent.target; this.setState({ value }); }; render() { const _value = this.state.value; return ( <ReactDemokit className="p-3 app-container" style={{ background: _value }} url="https://github.com/afeiship/react-ant-color-picker"> <ReactAntColorPicker value={_value} onChange={this.onChange} /> </ReactDemokit> ); } } ReactDOM.render(<App />, document.getElementById('app'));
documentation
license
Code released under the MIT license.
1.0.0
4 years ago