Package Exports
- @uiw/react-color-editable-input-rgba
- @uiw/react-color-editable-input-rgba/cjs/index.js
- @uiw/react-color-editable-input-rgba/esm/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@uiw/react-color-editable-input-rgba) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
React Color Editable Input RGBA
EditableInputRGBA Component is a subcomponent of @react-color
.
Install
npm i @uiw/react-color-editable-input-rgba
Usage
import { useState } from 'react';
import { hsvaToHex } from '@uiw/color-convert';
import EditableInputRGBA from '@uiw/react-color-editable-input-rgba';
function Demo() {
const [hsva, setHsva] = useState({ h: 209, s: 36, v: 90, a: 1 });
return (
<div style={{ padding: '0 10px 0 20px' }}>
<EditableInputRGBA
hsva={hsva}
onChange={(color) => {
setHsva({ ...hsva, ...color.hsva });
}}
/>
</div>
);
}
Props
import React from 'react';
import { EditableInputProps } from '@uiw/react-color-editable-input';
import { HsvaColor, ColorResult } from '@uiw/color-convert';
export interface EditableInputRGBAProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
prefixCls?: string;
hsva: HsvaColor;
placement?: 'top' | 'left' | 'bottom' | 'right';
rProps?: EditableInputProps;
gProps?: EditableInputProps;
bProps?: EditableInputProps;
aProps?: false | EditableInputProps;
onChange?: (color: ColorResult) => void;
}
License
Licensed under the MIT License.