Skip to content

Multi Select Combobox

Combobox with different configuration options that also supports multi select.

Available in: Not exposed in the Lightning App Builder - intended to be embedded in other components.

multi-select-combobox

Read on Medium

How to Create the LWC Multi-Select Combobox that Salesforce is Still Missing

How to Create the LWC Multi-Select Combobox that Salesforce is Still Missing

Attributes

NameTypeDefaultDescription
disabledbooleanfalseIf present, the combobox is disabled and users cannot interact with it.
enable-searchbooleanfalseIf present, a search input is shown inside the dropdown to filter options by label.
labelstring''Text label for the combobox.
namestringSpecifies the name of the combobox.
optionsArray[]A list of options that are available for selection. Each option has the following attributes: label and value.
placeholderstring'Select an Option'Text that is displayed before an option is selected, to prompt the user to select an option.
read-onlybooleanfalseIf present, the combobox is read-only. A read-only combobox is also disabled.
requiredbooleanfalseIf present, a value must be selected before a form can be submitted.
single-selectbooleanfalseIf present, the combobox only allows the selection of a single value.
show-pillsbooleanfalseIf present, the combobox will show a pill container with the currently selected options.

Usage

html
<c-multi-select-combobox
  label="Products"
  name="products"
  options={options}
  onchange={handleChange}
  show-pills
  enable-search
></c-multi-select-combobox>

Each option requires a label and a value.

Events

NameDetailDescription
changeThe selected options as an array, or a single option object if single-select is set.Fired when the selection changes.
close-Fired when the dropdown is closed.

Component Dependencies

NameTypeDescription
multiSelectComboboxItemLWCChild component that represents an item within the multiSelectCombobox parent component.

Released under the MIT License.