Elements

Reference

Color Picker

ColorPicker, dressed in the paper-and-ink system: a seal-sized swatch on the paper, opening into an area and channel sliders where pigment is picked. The parts — Root, Label, Control, Trigger, Positioner, Content, Area, AreaThumb, AreaBackground, ValueText, ValueSwatch, ChannelSlider, ChannelSliderLabel, ChannelSliderTrack, ChannelSliderThumb, ChannelSliderValueText, ChannelInput, TransparencyGrid, SwatchGroup, SwatchTrigger, SwatchIndicator, Swatch, EyeDropperTrigger, FormatTrigger, FormatSelect, HiddenInput, Context.

Root · Label · Control · Trigger · Positioner · Content · Area · AreaThumb · ValueText · AreaBackground · ChannelSlider · ChannelSliderLabel · ChannelSliderTrack · ChannelSliderThumb · ChannelSliderValueText · ChannelInput · TransparencyGrid · SwatchGroup · SwatchTrigger · SwatchIndicator · Swatch · EyeDropperTrigger · FormatTrigger · FormatSelect

#AreaBackground

A styled part — no props of its own; it takes the anatomy's shared styling.

#AreaThumb

A styled part — no props of its own; it takes the anatomy's shared styling.

#Area

PropTypeDefaultDescription
xChannelColorChannel | undefined—
yChannelColorChannel | undefined—

#ChannelInput

PropTypeDefaultDescription
channelExtendedColorChannel—
orientationOrientation | undefined—

#ChannelSliderLabel

A styled part — no props of its own; it takes the anatomy's shared styling.

#ChannelSliderThumb

A styled part — no props of its own; it takes the anatomy's shared styling.

#ChannelSliderTrack

A styled part — no props of its own; it takes the anatomy's shared styling.

#ChannelSliderValueText

A styled part — no props of its own; it takes the anatomy's shared styling.

#ChannelSlider

PropTypeDefaultDescription
channelColorChannel—
orientationOrientation | undefined—

#Content

A styled part — no props of its own; it takes the anatomy's shared styling.

#Control

A styled part — no props of its own; it takes the anatomy's shared styling.

#EyeDropperTrigger

A styled part — no props of its own; it takes the anatomy's shared styling.

#FormatSelect

A styled part — no props of its own; it takes the anatomy's shared styling.

#FormatTrigger

A styled part — no props of its own; it takes the anatomy's shared styling.

#HiddenInput

A styled part — no props of its own; it takes the anatomy's shared styling.

#Label

A styled part — no props of its own; it takes the anatomy's shared styling.

#Positioner

A styled part — no props of its own; it takes the anatomy's shared styling.

#Root

PropTypeDefaultDescription
sizeString as PropType<"sm" | "md" | "lg">"md"One rung of the control-height ladder for the swatch seal.
closeOnSelectbooleanfalseWhether to close the color picker when a swatch is selected
defaultFormatcolorPicker.ColorFormat"rgba"The initial color format when rendered. Use when you don't need to control the color format of the color picker.
defaultOpenbooleanThe initial open state of the color picker when rendered. Use when you don't need to control the open state of the color picker.
defaultValuecolorPicker.Color#000000The initial color value when rendered. Use when you don't need to control the color value of the color picker.
disabledbooleanWhether the color picker is disabled
formatcolorPicker.ColorFormatThe controlled color format to use
idstringThe unique identifier of the machine.
idsPartial<{ root: string; control: string; trigger: string; label: string; input: string; hiddenInput: string; content: string; area: string; areaGradient: string; positioner: string; formatSelect: string; areaThumb: string; channelInput(id: string): string; channelSliderTrack(id: colorPicker.ColorChannel): string; channelSliderThumb(id: colorPicker.ColorChannel): string; }>The ids of the elements in the color picker. Useful for composition.
initialFocusEl() => HTMLElement | nullThe initial focus element when the color picker is opened.
inlinebooleanWhether the color picker is inline
invalidbooleanWhether the color picker is invalid
modelValuecolorPicker.ColorThe v-model value of the color picker
namestringThe name for the form input
openbooleanThe controlled open state of the color picker
openAutoFocusbooleantrueWhether to auto focus the color picker when it is opened
positioningcolorPicker.PositioningOptionsThe positioning options for the color picker
readOnlybooleanWhether the color picker is read-only
requiredbooleanWhether the color picker is required
EventPayload
exitComplete—
valueChangedetails: ValueChangeDetails
update:modelValuevalue: Color
openChangedetails: OpenChangeDetails
update:openopen: boolean
valueChangeEnddetails: ValueChangeDetails
focusOutsideevent: FocusOutsideEvent
formatChangedetails: FormatChangeDetails
interactOutsideevent: InteractOutsideEvent
pointerDownOutsideevent: PointerDownOutsideEvent
update:formatformat: ColorFormat

#SwatchGroup

A styled part — no props of its own; it takes the anatomy's shared styling.

#SwatchIndicator

A styled part — no props of its own; it takes the anatomy's shared styling.

#SwatchTrigger

PropTypeDefaultDescription
disabledboolean | undefinedWhether the swatch trigger is disabled
valuestring | ColorThe color value

#Swatch

PropTypeDefaultDescription
respectAlphaboolean | undefinedWhether to include the alpha channel in the color
valuestring | ColorThe color value

#TransparencyGrid

PropTypeDefaultDescription
sizestring | undefined—

#Trigger

A styled part — no props of its own; it takes the anatomy's shared styling.

#ValueSwatch

A styled part — no props of its own; it takes the anatomy's shared styling.

#ValueText

PropTypeDefaultDescription
formatColorStringFormat—

#View

PropTypeDefaultDescription
formatColorFormat—