Skip to main content

Multiselect Combobox

Mger Ktoian
Mger Ktoian

example

Usage​

Add the component to your template and pass the available options plus the currently selected values:

<c-multiselect-combobox
label="Select Fruits"
placeholder="Choose fruits..."
options={fruitOptions}
value={selectedFruits}
onchange={handleSelectionChange}
></c-multiselect-combobox>
fruitOptions = [
{ label: 'Apple', value: 'apple' },
{ label: 'Banana', value: 'banana' },
{ label: 'Cherry', value: 'cherry' }
];

handleSelectionChange(event) {
this.selectedFruits = event.detail.value;
}

Properties​

Namerequired?typeDescription/Example
labeloptionalStringField label shown above the combobox.
placeholderoptionalStringText shown when no value is selected. Defaults to "Select Options".
optionsrequiredArray of objectsAvailable options, e.g. [{ label: 'Apple', value: 'apple' }].
valueoptionalArray of stringsSelected option values, e.g. ['apple', 'banana'].
disabledoptionalBooleanDisables interaction and greys out the field when set to true.
hidePillsoptionalBooleanHides the selected-value pills below the combobox when set to true.

Events​

NameDescription/Example
changeFired whenever selection changes. event.detail.value contains the value array.

Demo​

See sampleMultiselectCombobox for a full working example that shows selected values and demonstrates handling the change event.