MultiSelect
The MultiSelect component is a form component that lets users pick several options from a scrollable list.
Import
- React
- Angular
- Vue.js
// with @dhl-official/react-library:
import { DhlMultiSelect } from "@dhl-official/react-library"
// with @dhl-official/ui-libraries/react-library:
import { DhlMultiSelect } from "@dhl-official/ui-libraries/react-library"
If the DUIL has been installed, you can use the web component directly:
<dhl-multi-select></dhl-multi-select>
If the DUIL has been installed, you can use the web component directly:
<dhl-multi-select></dhl-multi-select>
By default, menu list opens below the input. If there isn't enough space left in the viewport, it automatically opens above the input instead — no configuration required.
Code
- React
- Angular
- Vue.js
<DhlMultiSelect options={options}></DhlMultiSelect>
<duil301-dhl-multi-select [options]="options" ></duil301-dhl-multi-select>
<duil301-dhl-multi-select :options.prop="options" ></duil301-dhl-multi-select>
The options property should be passed to the component as an array; objects within this array accept 4 values, label, value, image and disabled. The label and value properties are required. However, image and disabled are optional. Any other values that are added to this object will be ignored by default, however they can be taken into consideration when using them with custom props such as the customFilter. The select option type definition is as follows:
type DhlMultiSelectOptionType = {
label: string;
value: string;
image?: string;
disabled?: boolean;
}