Yamada UIにスターをあげる

スター
Yamada UIYamada UIv1.5.1

Autocomplete

Autocompleteは、ユーザーのテキスト入力に応じて候補を表示するために使用されるコンポーネントです。

ソース@yamada-ui/autocomplete

Props

AutocompleteProps

allowCreate

説明

If true, enables the creation of autocomplete option.

タイプ

boolean

デフォルト

false

allowFree

説明

If true, enables the free input.

タイプ

boolean

animation

説明

The animation of the popover.

タイプ

"bottom" | "left" | "right" | "top" | "scale" | "none"

デフォルト

'scale'

boundary

説明

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

タイプ

HTMLElement | "clippingParents" | "scrollParent"

デフォルト

'clippingParents'

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

closeOnSelect

説明

If true, the list element will be closed when value is selected.

タイプ

boolean

デフォルト

true

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"

containerProps

説明

Props for autocomplete container element.

タイプ

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

createProps

説明

Props for autocomplete create element.

タイプ

Omit<AutocompleteCreateProps, "children">

defaultIsOpen

説明

If true, the popover will be initially opened.

タイプ

boolean

defaultValue

説明

The initial value of the autocomplete.

タイプ

string

duration

説明

The animation duration.

タイプ

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

emptyMessage

説明

The message displayed when the search yields no hits.

タイプ

string

デフォルト

'No results found'

emptyProps

説明

Props for autocomplete empty element.

タイプ

Omit<AutocompleteEmptyProps, "children">

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

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

説明

Function to format text when search input.

タイプ

(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

iconProps

説明

Props for autocomplete icon element.

タイプ

AutocompleteIconProps

inputProps

説明

Props for autocomplete input element.

タイプ

HTMLUIProps<"input">

insertPositionItem

説明

The position to be inserted when the autocomplete option is created.

タイプ

string | [string, "first" | "last"]

デフォルト

'first'

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

items

説明

If provided, generate options based on items.

タイプ

AutocompleteItem[]

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'

listProps

説明

Props for autocomplete list element.

タイプ

Omit<AutocompleteListProps, "children">

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

説明

The callback invoked when value state changes.

タイプ

(value: string) => void

onClose

説明

Callback fired when the popover closes.

タイプ

() => void

onCreate

説明

The callback invoked when autocomplete option created.

タイプ

( newItem: AutocompleteItem, newItems: AutocompleteItem[], ) => void

onOpen

説明

Callback fired when the popover opens.

タイプ

() => void

onSearch

説明

The callback invoked when search input.

タイプ

(ev: ChangeEvent<HTMLInputElement>) => void

optionProps

説明

Props for select option element.

タイプ

Omit<AutocompleteOptionProps, "value" | "children">

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>

size

説明

The size of the Autocomplete.

タイプ

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

デフォルト

md

strategy

説明

The CSS positioning strategy to use.

タイプ

"fixed" | "absolute"

デフォルト

'absolute'

value

説明

The value of the autocomplete.

タイプ

string

variant

説明

The variant of the Autocomplete.

タイプ

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

デフォルト

outline

AutocompleteOptionGroupProps

label

必須

説明

The label of the autocomplete option group.

タイプ

string

AutocompleteOptionProps

closeOnSelect

説明

If true, the list element will be closed when selected.

タイプ

boolean

デフォルト

false

icon

説明

The autocomplete option icon to use.

タイプ

ReactElement<any, string | JSXElementConstructor<any>>

isDisabled

説明

If true, the select option will be disabled.

タイプ

boolean

デフォルト

false

isFocusable

説明

If true, the select option will be focusable.

タイプ

boolean

デフォルト

false

value

説明

The value of the select option.

タイプ

string

AutocompleteCreateProps

icon

説明

The autocomplete create option icon to use.

タイプ

ReactElement<any, string | JSXElementConstructor<any>>

AutocompleteEmptyProps

icon

説明

The autocomplete empty option icon to use.

タイプ

ReactElement<any, string | JSXElementConstructor<any>>

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

NativeSelectMultiAutocomplete