Skip to main content
Version: Next

ColorPicker API

import { ColorPicker } from '@editora/ui-react';

Props​

PropTypeDescription
alphaboolean
closeOnEscapeboolean
disabledboolean
format'hex' | 'rgb' | 'hsl'
maxRecentnumber
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
openboolean
persistboolean
placeholderstring
presetsstring[]
readOnlyboolean
recentboolean
size'sm' | 'md' | 'lg'
stateColorPickerState
toneColorPickerTone
valuestring
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