ColorField

A color field allows users to edit a hex color or individual color channel value.

Examples

Disabled

Composed with ColorSwatch, Popover, DialogTrigger, and ColorSlider

Props

channel
ColorChannel
colorSpace
ColorSpace
id
string
name
string
onCopy
ClipboardEventHandler<HTMLInputElement>
onCut
ClipboardEventHandler<HTMLInputElement>
onPaste
ClipboardEventHandler<HTMLInputElement>
onCompositionEnd
CompositionEventHandler<HTMLInputElement>
onCompositionStart
CompositionEventHandler<HTMLInputElement>
onCompositionUpdate
CompositionEventHandler<HTMLInputElement>
onFocus
((e: FocusEvent<Element, Element>) => void)
onBlur
((e: FocusEvent<Element, Element>) => void)
onChange
((color: Color | null) => void)
onBeforeInput
FormEventHandler<HTMLInputElement>
onInput
FormEventHandler<HTMLInputElement>
onKeyDown
((e: KeyboardEvent) => void)
onKeyUp
((e: KeyboardEvent) => void)
onSelect
ReactEventHandler<HTMLInputElement>
isDisabled
boolean
autoFocus
boolean
onFocusChange
((isFocused: boolean) => void)
excludeFromTabOrder
boolean
value
string | Color | null
defaultValue
string | Color | null
isReadOnly
boolean
isRequired
boolean
isInvalid
boolean
validate
((value: Color | null) => true | ValidationError | null)
isWheelDisabled
boolean
validationBehavior
"native" | "aria"'native'
children
ReactNode | ((values: ColorFieldRenderProps & { defaultChildren: ReactNode; }) => ReactNode)
className
string | ((values: ColorFieldRenderProps & { defaultClassName: string; }) => string)
style
CSSProperties | ((values: ColorFieldRenderProps & { defaultStyle: CSSProperties; }) => CSSProperties)
slot
string | null
ref
ForwardedRef<HTMLInputElement>