Skip to content

MultiSelect

Use MultiSelect to let a shopper search and select multiple values from a dropdown. It supports filtering, select-all and deselect-all controls, and error and success states.

The SDK MultiSelect showing several selected values.
import { MultiSelect } from '/@dropins/tools/components.js';
PropTypeReq?Description
optionsOption[]YesThe selectable options. Each option has a label, a value (string or number), and an optional disabled flag.
value(string | number)[]YesThe currently selected values.
onChange(value: (string | number)[]) => voidYesCalled with the updated selection when it changes.
placeholderstringNoText shown when no options are selected.
floatingLabelstringNoFloating label text.
selectAllTextstringNoLabel for the select-all control.
deselectAllTextstringNoLabel for the deselect-all control.
noResultsTextstringNoText shown when a search returns no matches.
namestringNoForm field identifier. Defaults to multi-select-sdk.
idstringNoBase id used to generate ids for the component’s hidden input, search input, and dropdown listbox. Defaults to the name value when not set.
maxHeightnumberNoMaximum height of the dropdown list, in pixels. Defaults to 300.
disabledbooleanNoDisable the entire component.
errorbooleanNoShow the error state styling.
successbooleanNoShow the success state styling.
classNamestringNoAdditional CSS class names.
import { MultiSelect, provider } from '/@dropins/tools/components.js';
const instance = await provider.render(MultiSelect, {
options: [
{ label: 'Red', value: 'red' },
{ label: 'Blue', value: 'blue' },
{ label: 'Green', value: 'green', disabled: true },
],
value: [],
onChange: (value) => instance.setProps((prev) => ({ ...prev, value })),
placeholder: 'Select colors',
})(document.querySelector('.color-select'));
  • Picker — select a single option from a dropdown.
  • Checkbox — for a small, fixed set of toggles.