ColorPicker

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

Usage

import { ColorPicker } from "@yamada-ui/react"
<ColorPicker />

Change Variant

Change Size

Change Color Scheme

Set Default Value

To set a default value, set defaultValue to a value.

Set Alpha Value

To set an alpha value, set defaultValue to a value containing an alpha value or set format to "hexa" or "hsla" etc.

Change Format

To change the format, set format to a value. The default is to determine the format from the string of value or defaultValue.

Limit Input Value

To limit the input value, set pattern to a regular expression.

Format Input Value

To format the input value, set formatInput to a function.

Show Color Swatches

To show color swatches, set colorSwatches to an array.

Change Color Swatch Columns

To change the number of columns in the color swatch group, set colorSwatchGroupColumns to a number.

Change Offset

To change the offset, set gutter or offset to a value.

Change Animation Scheme

To change the animation scheme, set animationScheme to "block-start" or "inline-end" etc. The default is "scale".

Change Placement

To change the placement, set placement to "end" or "start-center" etc. The default is "end-start".

Blocking Scroll

To block scrolling, set blockScrollOnMount to true.

Close Dropdown On Scroll

To close the dropdown on scroll, set closeOnScroll to true.

Handle Opening Dropdown On Change

To handle the event of opening the dropdown on change, set a function to openOnChange.

Handle Closing Dropdown On Change

To handle the event of closing the dropdown on change, set a function to closeOnChange.

Disable Open Dropdown On Focus

To disable opening the dropdown on focus, set openOnFocus to false.

Disable Open Dropdown On Click

To disable opening the dropdown on click, set openOnClick to false.

Disable Close On Outside Click

To disable closing the dropdown on outside click, set closeOnBlur to false.

Disable Close On Esc

To disable closing the dropdown on ESC key, set closeOnEsc to false.

Disable Allow Input

To disable allowing input, set allowInput to false.

Change Shape

Disable

To disable, set disabled to true.

Make Read Only

To make read only, set readOnly to true.

Make Invalid

To make invalid, set invalid to true.

Change Border Color

To change the border color, set focusBorderColor or errorBorderColor to a value.

Control

Props

Accessibility

Currently, this section is being updated due to the migration of v2.