Leave Yamada UI a star

Star
Yamada UIYamada UIv1.6.4

MultiAutocomplete

MultiAutocomplete is a component used to display suggestions based on user text input and to obtain multiple values.

Source@yamada-ui/autocomplete

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

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

<MultiAutocomplete placeholder="キャラクターを選択" aria-label="キャラクター">
<AutocompleteOption value="孫悟空">孫悟空</AutocompleteOption>
<AutocompleteOption value="ベジータ">ベジータ</AutocompleteOption>
<AutocompleteOption value="フリーザ">フリーザ</AutocompleteOption>
</MultiAutocomplete>
Copied!
<VStack gap="sm">
<Heading as="h3" id="label">
キャラクター
</Heading>
<MultiAutocomplete placeholder="キャラクターを選択" aria-labelledby="label">
<AutocompleteOption value="孫悟空">孫悟空</AutocompleteOption>
<AutocompleteOption value="ベジータ">ベジータ</AutocompleteOption>
<AutocompleteOption value="フリーザ">フリーザ</AutocompleteOption>
</MultiAutocomplete>
</VStack>
Copied!

Keyboard Navigation

KeyDescriptionState
ArrowUpFocuses the previous non-disabled item. If on the first item, focuses the last non-disabled item.-
ArrowDownFocuses the next non-disabled item. If on the last item, focuses the first non-disabled item.-
HomeFocuses the first non-disabled item.-
EndFocuses the last non-disabled item.-
Space, EnterSelects the focused item and closes the listbox.-
EscapeCloses the listbox.closeOnEsc={true}

ARIA Roles and Attributes

ComponentRoles and AttributesUsage
MultiAutocompleteField Internalrole="combobox"Indicates that this is a combobox.
aria-haspopup="listbox"Indicates that a listbox exists.
aria-autocomplete="list"Indicates that the component proposes a list of values related to the input value.
aria-activedescendantSet to the id of the focused item.
aria-expandedSet to "true" when the listbox is open, "false" when closed.
aria-controlsSet to the id of the related MultiAutocompleteList 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.
AutocompleteClearIcon Internalrole="button"Indicates that this is a button.
aria-label"Clear value" is set.
MultiAutocompleteList Internalrole="listbox"Indicates that this is a listbox.
idThe id used to associate with MultiAutocompleteField.
aria-multiselectableIndicates that multiple selection is possible.
aria-hiddenSet to "true" when the listbox is open, "false" when closed.
AutocompleteOptionGrouprole="group"Indicates that this is a group.
aria-labelledbySets the id of the associated AutocompleteOptionGroupLabel.
AutocompleteOptionGroupLabel Internalrole="presentation"Indicates that this is a presentation.
idThe id used to associate with AutocompleteOptionGroup.
AutocompleteOptionrole="option"Indicates that this is an option.
idThe id used to associate with MultiAutocompleteField.
aria-selectedSet to "true" when the option is selected, "false" when not selected.
aria-disabledSet to "true" when isDisabled is set.

Edit this page on GitHub

PreviousAutocompleteNextDatePicker