1.0.4 • Published 6 years ago

fabric-ui-react-color-input v1.0.4

Weekly downloads
1
License
ISC
Repository
github
Last release
6 years ago

Color input component

Allows you to use the color input component from this example

Installing

npm install fabric-ui-react-color-input --save

Example

import * as React from 'react';
import { ColorInput } from 'fabric-ui-react-color-input';
import { Fabric } from 'office-ui-fabric-react/lib/Fabric';

export interface IAppState {
    color: string;
}

export class App extends React.PureComponent<{}, IAppState> {

    constructor(props) {
        super(props);
        this.state = {
            color: 'red'
        };
    }

    public render(): React.ReactElement<{}> {
        return (
            <Fabric>
                <ColorInput value={this.state.color} onChange={this._handleColorChange} />
            </Fabric>
        );
    }

    private _handleColorChange = color => this.setState({ color });

}