Leave Yamada UI a star

Star
Yamada UIYamada UIv1.6.4

MultiSelect

MultiSelect is a component used for allowing users to select multiple values from a list of options.

Source@yamada-ui/select

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

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

<MultiSelect placeholder="キャラクターを選択" aria-label="キャラクター">
<Option value="孫悟空">孫悟空</Option>
<Option value="ベジータ">ベジータ</Option>
<Option value="フリーザ">フリーザ</Option>
</MultiSelect>
Copied!
<VStack gap="sm">
<Heading as="h3" id="label">
キャラクター
</Heading>
<MultiSelect placeholder="キャラクターを選択" aria-labelledby="label">
<Option value="孫悟空">孫悟空</Option>
<Option value="ベジータ">ベジータ</Option>
<Option value="フリーザ">フリーザ</Option>
</MultiSelect>
</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
MultiSelectField Internalrole="combobox"Indicates that this is a combobox.
aria-haspopup="listbox"Indicates that a listbox exists.
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 MultiSelectList 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.
SelectClearIcon Internalrole="button"Indicates that this is a button.
aria-label"Clear value" is set.
MultiSelectList Internalrole="listbox"Indicates that this is a listbox.
idThe id used to associate with MultiSelectField.
aria-multiselectableIndicates that multiple selection is possible.
aria-hiddenSet to "true" when the listbox is open, "false" when closed.
OptionGrouprole="group"Indicates that this is a group.
aria-labelledbySets the id of the associated OptionGroupLabel.
OptionGroupLabel Internalrole="presentation"Indicates that this is a presentation.
idThe id used to associate with OptionGroup.
Optionrole="option"Indicates that this is an option.
idThe id used to associate with MultiSelectField.
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

PreviousSelectNextNativeSelect