React Color Chrome
Chrome Component is a subcomponent of @react-color
.
Install
npm i @uiw/react-color-chorme
Usage
import Chrome from '@uiw/react-color-chrome';
import { GithubPlacement } from '@uiw/react-color-github';
function Demo() {
const [hex, setHex] = useState("#fff");
return (
<Chrome
color={hex}
placement={GithubPlacement.Right}
onChange={(color) => {
setHex(color.hex);
}}
/>
);
}
Props
import { GithubProps } from '@uiw/react-color-github';
export enum ChromeInputType {
HEXA = 'hexa',
RGBA = 'rgba',
HSLA = 'hsla',
}
export interface ChromeProps extends Omit<GithubProps, 'colors'> {
inputType?: ChromeInputType;
}
License
Licensed under the MIT License.