Leave Yamada UI a star

Star
Yamada UIYamada UIv1.6.4

ColorPicker

ColorPicker is a component used by the user to select a color or enter an arbitrary color value.

Source@yamada-ui/color-picker

The ColorPicker follows the WAI-ARIA - Combobox Pattern for accessibility.

If you are not using FormControl, set aria-label or aria-labelledby to ColorPicker.

<ColorPicker placeholder="#4387f4" aria-label="Pick color" />
Copied!
<VStack gap="sm">
<Heading as="h3" id="label">
Pick Color
</Heading>
<ColorPicker placeholder="#4387f4" aria-labelledby="label" />
</VStack>
Copied!

Keyboard Navigation

KeyDescriptionState
EscapeCloses the dialog.closeOnEsc={true}

ARIA Roles and Attributes

ComponentRoles and AttributesUsage
ColorPickerField Internalrole="combobox"Indicates that this is a combobox.
aria-haspopup="dialog"Indicates that a dialog exists.
aria-expandedSet to "true" when the dialog is open, "false" when closed.
aria-controlsSet to the id of the related ColorSelector when open, undefined when closed.
aria-readonlySet to "true" when isReadOnly is set.
aria-disabledSet to "true" when isDisabled is set.
aria-invalidSet to "true" when isInvalid is set.
aria-requiredSet to "true" when isRequired is set.
ColorPickerSwatch Internalrole="img"Indicates that this is an image.
aria-roledescriptionSet to "color swatch".
aria-labelSet to the current value, such as "#141414".
ColorPickerEyeDropper Internalrole="button"Indicates that this is a button.
aria-label"Pick a color" is set.
ColorSelector Internalrole="dialog"Indicates that this is a dialog.
idThe id used to associate with ColorPickerField.
aria-hiddenSet to "true" when the dialog is open, "false" when closed.
SaturationSliderThumb Internalrole="slider"Indicates that the element is a slider.
aria-roledescription"2D slider" is set.
aria-label"Saturation and brightness thumb" is set.
aria-valueminSets the 0 value.
aria-valuemaxSets the 100 value.
aria-valuenowThe current value is set.
aria-valuetextSets the current value, such as "saturation 0.72, brightness 0.96".
HueSliderThumb Internalrole="slider"Indicates that this is a slider.
aria-labelSets "Slider thumb".
aria-valueminSets the 0 value.
aria-valuemaxSets the 360 value.
aria-valuenowSets the current value.
aria-valuetextSets the current value, such as "18°, Red".
AlphaSliderThumb Internalrole="slider"Indicates that the element is a slider.
aria-labelSets "Slider thumb".
aria-valueminSets the 0 value.
aria-valuemaxSets the 1 value.
aria-valuenowSets the current value.
aria-valuetextSets the current value, such as "18%".

Edit this page on GitHub

PreviousYearPickerNextFileInput