react-input-color
Version:
React input color component with hsv color picker
64 lines (46 loc) • 1.99 kB
Markdown
[](https://www.npmjs.com/package/react-input-color)
[](https://www.npmjs.com/package/react-input-color)
[](https://travis-ci.org/swiftcarrot/react-input-color)
[](https://codecov.io/gh/swiftcarrot/react-input-color)
[](https://github.com/prettier/prettier)
React input color component with hsv color picker
The color picker is inspired by the [sketch](https://www.sketchapp.com/) color picker

Starting from v2, this component is rewritten with [emotion](https://emotion.sh/) and it doesnot require any external css file.
```sh
npm install react-input-color --save
yarn add react-input-color
```
[](https://react-input-color.caitouyun.com)
The `initialValue` property supports 6 (`
```javascript
import React from 'react';
import InputColor from 'react-input-color';
function App() {
const [color, setColor] = React.useState({});
return (
<div>
<InputColor
initialValue="#5e72e4"
onChange={setColor}
placement="right"
/>
<div
style={{
width: 50,
height: 50,
marginTop: 20,
backgroundColor: color.rgba,
}}
/>
</div>
);
}
```
- This component is built with [react-input-slider](https://github.com/swiftcarrot/react-input-slider) and [react-input-number](https://github.com/swiftcarrot/react-input-number).
MIT