Yamada UIにスターをあげる

スター
Yamada UIYamada UIv1.5.1

ColorPicker

ColorPickerは、ユーザーが色を選択したり任意の色の値を入力するために使用されるコンポーネントです。

ソース@yamada-ui/color-picker

Props

ColorPickerProps

allowInput

説明

If true, allows input.

タイプ

boolean

デフォルト

true

alphaSliderProps

説明

Props for the alpha slider component.

タイプ

Omit<AlphaSliderProps, "defaultValue" | "value">

alphaSliderRef

説明

Ref for the alpha slider component.

タイプ

type ONLY_FOR_FORMAT = | ((instance: HTMLInputElement | null) => void) | MutableRefObject<HTMLInputElement | null>

boundary

説明

The boundary area for the popper. Used within the preventOverflow modifier.

タイプ

HTMLElement | "clippingParents" | "scrollParent"

デフォルト

'clippingParents'

channelProps

説明

Props for the chancel component.

タイプ

Omit<ColorSelectorChannelProps, "channelLabel">

channelsProps

説明

Props for the channels component.

タイプ

ColorSelectorChannelsProps

closeOnBlur

説明

If true, the popover will close when you blur out it by clicking outside or tabbing out.

タイプ

boolean

デフォルト

true

closeOnEsc

説明

If true, the popover will close when you hit the Esc key.

タイプ

boolean

デフォルト

true

closeOnSelectSwatch

説明

If true, the color swatch will be closed when value is selected.

タイプ

boolean

colorScheme

説明

The visual color appearance of the component.

タイプ

"whiteAlpha" | "blackAlpha" | "gray" | "neutral" | "red" | "rose" | "pink" | "flashy" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia"

colorSelectorColorScheme

説明

ColorScheme for the color selector component.

タイプ

"link" | (string & {}) | "whiteAlpha" | "blackAlpha" | "gray" | "neutral" | "red" | "danger" | "rose" | "pink" | "flashy" | "orange" | "warning" | "amber" | "yellow" | "lime" | "green" | ... 12 more ... | "fuchsia"

colorSelectorProps

説明

Props for color selector component.

タイプ

ColorSelectorProps

colorSelectorSize

説明

Size for the color selector component.

タイプ

UIValue<(string & {}) | "sm" | "md" | "lg" | "full">

colorSelectorVariant

説明

Variant for the color selector component.

タイプ

UIValue<string & {}>

containerProps

説明

Props for color picker container element.

タイプ

Omit<HTMLUIProps<"div">, "children">

defaultColor

説明

The initial value of the color selector.

タイプ

string

defaultIsOpen

説明

If true, the popover will be initially opened.

タイプ

boolean

defaultValue

説明

The initial value of the color selector.

タイプ

string

duration

説明

The animation duration.

タイプ

number | Partial<Record<"enter" | "exit", number>>

errorBorderColor

説明

The border color when the input is invalid.

タイプ

string

eventListeners

説明

If provided, determines whether the popper will reposition itself on scroll and resize of the window.

タイプ

type ONLY_FOR_FORMAT = | boolean | { scroll?: boolean | undefined; resize?: boolean | undefined }

デフォルト

true

eyeDropperProps

説明

Props for color eye dropper component.

タイプ

ColorPickerEyeDropperProps

fallbackValue

説明

The fallback value returned when color determination fails.

タイプ

string

flip

説明

If true, the popper will change its placement and flip when it's about to overflow its boundary area.

タイプ

boolean

デフォルト

true

focusBorderColor

説明

The border color when the input is focused.

タイプ

string

format

説明

Color format. For example, hex, rgba, etc.

タイプ

ColorFormat

デフォルト

hexa

formatInput

説明

A callback function to format the input entered.

タイプ

(value: string) => string

gutter

説明

The distance or margin between the reference and popper. It is used internally to create an offset modifier.

タイプ

UIValue<number>

デフォルト

8

hueSliderProps

説明

Props for the hue slider component.

タイプ

Omit<HueSliderProps, "defaultValue" | "value">

hueSliderRef

説明

Ref for the hue slider component.

タイプ

type ONLY_FOR_FORMAT = | ((instance: HTMLInputElement | null) => void) | MutableRefObject<HTMLInputElement | null>

inputProps

説明

Props for color picker element.

タイプ

HTMLUIProps<"input">

isDisabled

説明

If true, the form control will be disabled.

タイプ

boolean

デフォルト

false

isInvalid

説明

If true, the form control will be invalid.

タイプ

boolean

デフォルト

false

isLazy

説明

If true, the PopoverContent rendering will be deferred until the popover is open.

タイプ

boolean

デフォルト

false

isOpen

説明

If true, the popover will be opened.

タイプ

boolean

isReadOnly

説明

If true, the form control will be readonly.

タイプ

boolean

デフォルト

false

isRequired

説明

If true, the form control will be required.

タイプ

boolean

デフォルト

false

lazyBehavior

説明

The lazy behavior of popover's content when not visible. Only works when isLazy={true} - unmount: The popover's content is always unmounted when not open. - keepMounted: The popover's content initially unmounted, but stays mounted when popover is open.

タイプ

LazyMode

デフォルト

'unmount'

matchWidth

説明

If true, the popper will match the width of the reference at all times. It's useful for autocomplete, date-picker and select patterns.

タイプ

boolean

デフォルト

false

modifiers

説明

Array of popper.js modifiers. Check the docs to see the list of possible modifiers you can pass.

タイプ

Partial<Modifier<string, any>>[]

ドキュメント

https://popper.js.org/docs/v2/modifiers/

offset

説明

The main and cross-axis offset to displace popper element from its reference element.

タイプ

[number, number]

onChange

説明

Function called whenever the color selector value changes.

タイプ

(value: string) => void

onChangeEnd

説明

Function called when the user is done selecting a new value.

タイプ

(value: string) => void

onChangeStart

説明

Function called when the user starts selecting a new value.

タイプ

(value: string) => void

onClose

説明

Callback fired when the popover closes.

タイプ

() => void

onOpen

説明

Callback fired when the popover opens.

タイプ

() => void

onSwatchClick

説明

Function called whenever the color swatch click.

タイプ

(value: string) => void

placement

説明

The placement of the popper relative to its reference.

タイプ

UIValue<Placement>

デフォルト

'bottom'

portalProps

説明

Props to be forwarded to the portal component.

タイプ

Omit<PortalProps, "children">

デフォルト

'{ isDisabled: true }'

preventOverflow

説明

If true, will prevent the popper from being cut off and ensure it's visible within the boundary area.

タイプ

boolean

デフォルト

true

relatedRef

説明

The ref of the element related to the popover. This is used during the onBlur event.

タイプ

RefObject<HTMLElement>

saturationSliderProps

説明

Props for the saturation slider component.

タイプ

Omit<SaturationSliderProps, "defaultValue" | "value">

saturationSliderRef

説明

Ref for the saturation slider component.

タイプ

type ONLY_FOR_FORMAT = | ((instance: HTMLInputElement | null) => void) | MutableRefObject<HTMLInputElement | null>

size

説明

The size of the ColorPicker.

タイプ

"xs" | "sm" | "md" | "lg"

デフォルト

md

strategy

説明

The CSS positioning strategy to use.

タイプ

"fixed" | "absolute"

デフォルト

'absolute'

swatches

説明

An array of colors in one of the supported formats. Used to render swatches list below the color selector.

タイプ

string[]

swatchesColumns

説明

Number of swatches grid columns.

タイプ

UIValue<number>

デフォルト

7

swatchesLabel

説明

The swatches label to use.

タイプ

type ONLY_FOR_FORMAT = | string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal

swatchesProps

説明

Props for the swatches component.

タイプ

ColorSelectorSwatchesProps

swatchProps

説明

Props for color swatch component.

タイプ

ColorSwatchProps

value

説明

The value of the color selector.

タイプ

string

variant

説明

The variant of the ColorPicker.

タイプ

"outline" | "filled" | "flushed" | "unstyled"

デフォルト

outline

withChannel

説明

If true, display the channels component.

タイプ

boolean

デフォルト

true

withColorSelectorEyeDropper

説明

If true display the eye dropper component.

タイプ

boolean

デフォルト

false

withEyeDropper

説明

If true, display the eye dropper component.

タイプ

boolean

デフォルト

true

withPicker

説明

If true, display the saturation, hue, alpha, channels and eye dropper component.

タイプ

boolean

デフォルト

true

withResult

説明

If true, display the result component.

タイプ

boolean

デフォルト

false

withSwatch

説明

If true, display the color swatch component.

タイプ

boolean

デフォルト

true

GitHubでこのページを編集する

YearPickerFileInput