ColorPicker API
import { ColorPicker } from '@editora/ui-react';
Props
| Prop | Type | Description |
|---|---|---|
alpha | boolean | |
closeOnEscape | boolean | |
disabled | boolean | |
format | 'hex' | 'rgb' | 'hsl' | |
maxRecent | number | |
mode | 'inline' | 'popover' | |
onChange | (detail: ColorPickerDetail) => void | |
onClose | () => void | |
onCloseDetail | (detail: ColorPickerOpenDetail) => void | |
onInput | (detail: ColorPickerDetail) => void | |
onInvalid | (detail: { raw: string; reason: string }) => void | |
onOpen | () => void | |
onOpenDetail | (detail: ColorPickerOpenDetail) => void | |
onValueChange | (value: string) => void | |
open | boolean | |
persist | boolean | |
placeholder | string | |
presets | string[] | |
readOnly | boolean | |
recent | boolean | |
size | 'sm' | 'md' | 'lg' | |
state | ColorPickerState | |
tone | ColorPickerTone | |
value | string | |
variant | 'default' | 'contrast' |
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Element: <ui-color-picker>
ColorPicker renders the ui-color-picker custom element from @editora/ui-core, which can also be used without React.
Attributes: alpha, aria-describedby, aria-label, aria-labelledby, close-on-escape, disabled, format, max-recent, mode, open, persist, placeholder, presets, readonly, recent, size, state, tone, value, variant
Events: change, close, input, invalid, open, toast, ui-close, ui-open