<ui5-multi-comboboxplaceholder="Type your value"><ui5-mcb-itemselectedtext="UI5"></ui5-mcb-item></ui5-multi-combobox><ui5-multi-comboboxreadonlyvalue="Readonly combo"><ui5-mcb-itemselectedtext="UI5"></ui5-mcb-item></ui5-multi-combobox><ui5-multi-comboboxdisabledvalue="Disabled combo"><ui5-mcb-itemselectedtext="UI5"></ui5-mcb-item></ui5-multi-combobox>
MultiComboBox with items
<ui5-multi-comboboxplaceholder="Choose your countries"><ui5-mcb-itemselectedtext="Argentina"></ui5-mcb-item><ui5-mcb-itemtext="Bulgaria"></ui5-mcb-item><ui5-mcb-itemtext="Denmark"></ui5-mcb-item><ui5-mcb-itemtext="England"></ui5-mcb-item><ui5-mcb-itemtext="Albania"></ui5-mcb-item><ui5-mcb-itemtext="Morocco"></ui5-mcb-item><ui5-mcb-itemtext="Portugal"></ui5-mcb-item><ui5-mcb-itemtext="Germany"></ui5-mcb-item><ui5-mcb-itemtext="Philippines"></ui5-mcb-item><ui5-mcb-itemtext="Paraguay"></ui5-mcb-item></ui5-multi-combobox>
MultiComboBox with free text input
<ui5-multi-comboboxplaceholder="Choose your countries"allow-custom-values><ui5-mcb-itemtext="Argentina"></ui5-mcb-item><ui5-mcb-itemselectedtext="Bulgaria"></ui5-mcb-item><ui5-mcb-itemtext="Denmark"></ui5-mcb-item><ui5-mcb-itemselectedtext="England"></ui5-mcb-item><ui5-mcb-itemtext="Albania"></ui5-mcb-item><ui5-mcb-itemtext="Morocco"></ui5-mcb-item><ui5-mcb-itemtext="Portugal"></ui5-mcb-item><ui5-mcb-itemselectedtext="Germany"></ui5-mcb-item><ui5-mcb-itemtext="Philippines"></ui5-mcb-item><ui5-mcb-itemtext="Paraguay"></ui5-mcb-item></ui5-multi-combobox>
<ui5-multi-comboboxplaceholder="Select a country"><ui5-mcb-group-itemtext="Asia"></ui5-mcb-group-item><ui5-mcb-itemtext="Afghanistan"></ui5-mcb-item><ui5-mcb-itemtext="China"></ui5-mcb-item><ui5-mcb-itemtext="India"></ui5-mcb-item><ui5-mcb-itemtext="Indonesia"></ui5-mcb-item><ui5-mcb-group-itemtext="Europe"></ui5-mcb-group-item><ui5-mcb-itemtext="Austria"></ui5-mcb-item><ui5-mcb-itemtext="Bulgaria"></ui5-mcb-item><ui5-mcb-itemtext="Germany"></ui5-mcb-item><ui5-mcb-itemtext="Italy"></ui5-mcb-item><ui5-mcb-group-itemtext="North America"></ui5-mcb-group-item><ui5-mcb-itemtext="Canada"></ui5-mcb-item><ui5-mcb-itemtext="Granada"></ui5-mcb-item><ui5-mcb-itemtext="Haiti"></ui5-mcb-item><ui5-mcb-itemtext="United States"></ui5-mcb-item></ui5-multi-combobox>
Overview
The ui5-multi-combobox component consists of a list box with items and a text field allowing the user to either type a value directly into the text field, or choose from the list of existing items.
The drop-down list is used for selecting and filtering values, it enables users to select one or more options from a predefined list. The control provides an editable input field to filter the list, and a dropdown arrow to expand/collapse the list of available options. The options in the list have checkboxes that permit multi-selection. Entered values are displayed as tokens.
Structure
The ui5-multi-combobox consists of the following elements:
Tokenizer - a list of tokens with selected options.
Input field - displays the selected option/s as token/s. Users can type to filter the list.
Drop-down arrow - expands\collapses the option list.
Option list - the list of available options.
Keyboard Handling
The ui5-multi-combobox provides advanced keyboard handling.
Picker
If the ui5-multi-combobox is focused, you can open or close the drop-down by pressing F4, ALT+UP or ALT+DOWN keys. Once the drop-down is opened, you can use the UP and DOWN arrow keys to navigate through the available options and select one by pressing the Space or Enter keys.
Tokens
Left/Right arrow keys - moves the focus selection form the currently focused token to the previous/next one (if available).
Delete - deletes the token and focuses the previous token.
Backspace - deletes the token and focus the next token.
CSS Shadow Parts
CSS Shadow Parts allow developers to style elements inside the Shadow DOM. The ui5-multi-combobox exposes the following CSS Shadow Parts:
token-{index} - Used to style each token(where token-0 corresponds to the first item)
ES6 Module Import
import "@ui5/webcomponents/dist/MultiComboBox";
Properties/Attributes
You can use both properties and attributes with the same effect. The name of each attribute is listed below the name of the property, if different.
Name
Type
Default Value
Description
accessibleName
accessible-name
string
Defines the accessible ARIA name of the component.
since v1.4.0
accessibleNameRef
accessible-name-ref
string
""
Receives id(or many ids) of the elements that label the component.
since v1.4.0
allowCustomValues
allow-custom-values
boolean
false
Defines if the user input will be prevented, if no matching item has been found
disabled
boolean
false
Defines whether the component is in disabled state.
Note: A disabled component is completely noninteractive.
filter
string
"StartsWithPerTerm"
Defines the filter type of the component. Available options are: StartsWithPerTerm, StartsWith, Contains and None.
noTypeahead
no-typeahead
boolean
false
Defines whether the value will be autcompleted to match an item
since v1.4.0
open
(readonly)
boolean
false
Indicates whether the dropdown is open. True if the dropdown is open, false otherwise.
since v1.0.0-rc.5
placeholder
string
""
Defines a short hint intended to aid the user with data entry when the component has no value.
readonly
boolean
false
Defines whether the component is read-only.
Note: A read-only component is not editable, but still provides visual feedback upon user interaction.
required
boolean
false
Defines whether the component is required.
since v1.0.0-rc.5
value
string
""
Defines the value of the component.
Note: The property is updated upon typing.
valueState
value-state
ValueState
"None"
Defines the value state of the component.
Available options are:
None
Error
Warning
Success
Information
Slots
This Element provides slot(s). This means it can display its child nodes.
Unless targeting the default slot, use the slot attribute to define the destination slot for each child.
Text, along with HTML Elements with no slot attribute, goes the the default slot.
Slot
Type
Description
default
HTMLElement [0..n]
Defines the component items.
icon
HTMLElement [0..n]
Defines the icon to be displayed in the component.
valueStateMessage
HTMLElement [0..n]
Defines the value state message that will be displayed as pop up under the component.
Note: If not specified, a default text (in the respective language) will be displayed. Note: The valueStateMessage would be displayed, when the component is in Information, Warning or Error value state.
Events
This Web Component fires semantic events upon user interaction. You can bind to these events with the standard DOM APIs, such as addEventListener.
Name
Description
change
Fired when the input operation has finished by pressing Enter or on focusout.
input
Fired when the value of the component changes at each keystroke.
open-change
Fired when the dropdown is opened or closed.
since v1.0.0-rc.5
selection-change
Fired when selection is changed by user interaction in SingleSelect and MultiSelect modes.
items
type: Array description: an array of the selected items.
MultiComboBoxItem
The ui5-mcb-item represents the item for a ui5-multi-combobox.
Properties/Attributes
You can use both properties and attributes with the same effect. The name of each attribute is listed below the name of the property, if different.
Name
Type
Default Value
Description
selected
boolean
false
Defines the selected state of the component.
additionalText
additional-text
string
""
Defines the additional text of the component.
since v1.0.0-rc.11
text
string
""
Defines the text of the component.
MultiComboBoxGroupItem
The ui5-mcb-group-item is type of suggestion item, that can be used to split the ui5-multi-combobox suggestions into groups.
Properties/Attributes
You can use both properties and attributes with the same effect. The name of each attribute is listed below the name of the property, if different.
Name
Type
Default Value
Description
text
string
""
Defines the text of the component.
Theme:Morning Horizon (Light)Evening Horizon (Dark)Horizon High Contrast BlackHorizon High Contrast WhiteQuartz LightQuartz DarkQuartz High Contrast BlackQuartz High Contrast White