# multiselect

```ts
import { MultiSelectModule } from '@anguless/angulux/multiselect';
```

## MultiSelectItem

`li[aglMultiSelectItem]` — component

Inherits every input, output and slot of `BaseComponent` — see [basecomponent.md](basecomponent.md).

| Input | Type | Default | Description |
| --- | --- | --- | --- |
| `option` | `any` | _not documented_ |  |
| `selected` | `boolean \| undefined` | _not documented_ |  |
| `label` | `string \| undefined` | _not documented_ |  |
| `disabled` | `boolean \| undefined` | _not documented_ |  |
| `itemSize` | `number \| undefined` | _not documented_ |  |
| `focused` | `boolean \| undefined` | _not documented_ |  |
| `ariaPosInset` | `string \| undefined` | _not documented_ |  |
| `ariaSetSize` | `string \| undefined` | _not documented_ |  |
| `variant` | `'outlined' \| 'filled'` | _not documented_ |  |
| `template` | `TemplateRef<MultiSelectItemTemplateContext> \| undefined` | _not documented_ |  |
| `checkIconTemplate` | `TemplateRef<MultiSelectItemCheckboxIconTemplateContext> \| undefined` | _not documented_ |  |
| `itemCheckboxIconTemplate` | `TemplateRef<MultiSelectItemCheckboxIconTemplateContext> \| undefined` | _not documented_ |  |
| `highlightOnSelect` | `boolean \| undefined` | _not documented_ |  |

| Output | Type | Description |
| --- | --- | --- |
| `onClick` | `EventEmitter<any>` |  |
| `onMouseEnter` | `EventEmitter<any>` |  |

## MultiSelect

`agl-multiSelect, agl-multiselect, agl-multi-select` — component

Inherits every input, output and slot of `BaseEditableHolder` — see [baseeditableholder.md](baseeditableholder.md).

MultiSelect is used to select multiple items from a collection.

Accessibility, a known limit: when there are more options than fit in the panel, axe reports the
scrolling list as a region the keyboard cannot reach (scrollable-region-focusable). The keyboard
does reach it, as in Select: focus stays on the combobox, or in the filter, and the arrow keys move
through the options with aria-activedescendant and scroll the list as they go. A tab stop on the
list would only add a stop that does nothing, so the list has none.

| Input | Type | Default | Description |
| --- | --- | --- | --- |
| `id` | `string \| undefined` | _not documented_ | Unique identifier of the component |
| `ariaLabel` | `string \| undefined` | _not documented_ | Defines a string that labels the input for accessibility. |
| `styleClass` | `string \| undefined` | _not documented_ | Style class of the element. **Deprecated:** since v20.0.0, use `class` instead. |
| `panelStyle` | `any` | _not documented_ | Inline style of the overlay panel. |
| `panelStyleClass` | `string \| undefined` | _not documented_ | Style class of the overlay panel element. |
| `inputId` | `string \| undefined` | _not documented_ | Identifier of the focus input to match a label defined for the component. |
| `readonly` | `boolean \| undefined` | _not documented_ | When present, it specifies that the component cannot be edited. |
| `group` | `boolean \| undefined` | _not documented_ | Whether to display options as grouped when nested options are provided. |
| `filter` | `boolean` | _not documented_ | When specified, displays an input field to filter the items on keyup. |
| `filterPlaceHolder` | `string \| undefined` | _not documented_ | Defines placeholder of the filter input. |
| `filterLocale` | `string \| undefined` | _not documented_ | Locale to use in filtering. The default locale is the host environment's current locale. |
| `overlayVisible` | `boolean \| undefined` | _not documented_ | Specifies the visibility of the options panel. |
| `tabindex` | `number \| undefined` | _not documented_ | Index of the element in tabbing order. |
| `dataKey` | `string \| undefined` | _not documented_ | A property to uniquely identify a value in options. |
| `ariaLabelledBy` | `string \| undefined` | _not documented_ | Establishes relationships between the component and label(s) where its value should be one or more element IDs. |
| `displaySelectedLabel` | `` | `true` | Whether to show labels of selected item labels or use default label. |
| `maxSelectedLabels` | `` | `3` | Decides how many selected item labels to show at most. |
| `selectionLimit` | `number \| undefined` | _not documented_ | Maximum number of selectable items. |
| `selectedItemsLabel` | `string \| undefined` | _not documented_ | Label to display after exceeding max selected labels e.g. ({0} items selected), defaults "ellipsis" keyword to indicate a text-overflow. |
| `showToggleAll` | `boolean` | _not documented_ | Whether to show the checkbox at header to toggle all items at once. |
| `emptyFilterMessage` | `string` | _not documented_ | Text to display when filtering does not return any results. |
| `emptyMessage` | `string` | _not documented_ | Text to display when there is no data. Defaults to global value in i18n translation configuration. |
| `resetFilterOnHide` | `boolean` | _not documented_ | Clears the filter value when hiding the dropdown. |
| `dropdownIcon` | `string \| undefined` | _not documented_ | Icon class of the dropdown icon. |
| `chipIcon` | `string \| undefined` | _not documented_ | Icon class of the chip icon. |
| `optionLabel` | `string \| undefined` | _not documented_ | Name of the label field of an option. |
| `optionValue` | `string \| undefined` | _not documented_ | Name of the value field of an option. |
| `optionDisabled` | `string \| undefined` | _not documented_ | Name of the disabled field of an option. |
| `optionGroupLabel` | `string \| undefined` | _not documented_ | Name of the label field of an option group. |
| `optionGroupChildren` | `string` | _not documented_ | Name of the options field of an option group. |
| `showHeader` | `boolean` | _not documented_ | Whether to show the header. |
| `filterBy` | `string \| undefined` | _not documented_ | When filtering is enabled, filterBy decides which field or fields (comma separated) to search against. |
| `scrollHeight` | `string` | _not documented_ | Height of the viewport in pixels, a scrollbar is defined if height of list exceeds this value. |
| `lazy` | `boolean` | _not documented_ | Defines if data is loaded and interacted with in lazy manner. |
| `virtualScroll` | `boolean \| undefined` | _not documented_ | Whether the data should be loaded on demand during scroll. |
| `loading` | `boolean \| undefined` | _not documented_ | Whether the multiselect is in loading state. |
| `virtualScrollItemSize` | `number \| undefined` | _not documented_ | Height of an item in the list for VirtualScrolling. |
| `loadingIcon` | `string \| undefined` | _not documented_ | Icon to display in loading state. |
| `virtualScrollOptions` | `ScrollerOptions \| undefined` | _not documented_ | Whether to use the scroller feature. The properties of scroller component can be used like an object in it. |
| `overlayOptions` | `OverlayOptions \| undefined` | _not documented_ | Whether to use overlay API feature. The properties of overlay API can be used like an object in it. |
| `ariaFilterLabel` | `string \| undefined` | _not documented_ | Defines a string that labels the filter input. |
| `filterMatchMode` | `'contains' \| 'startsWith' \| 'endsWith' \| 'equals' \| 'notEquals' \| 'in' \| 'lt' \| 'lte' \| 'gt' \| 'gte'` | _not documented_ | Defines how the items are filtered. |
| `tooltip` | `string` | _not documented_ | Advisory information to display in a tooltip on hover. |
| `tooltipPosition` | `'top' \| 'left' \| 'right' \| 'bottom'` | _not documented_ | Position of the tooltip. |
| `tooltipPositionStyle` | `string` | _not documented_ | Type of CSS position. |
| `tooltipStyleClass` | `string \| undefined` | _not documented_ | Style class of the tooltip. |
| `autofocusFilter` | `boolean` | _not documented_ | Applies focus to the filter element when the overlay is shown. |
| `display` | `string \| 'comma' \| 'chip'` | _not documented_ | Defines how the selected items are displayed. |
| `autocomplete` | `string` | _not documented_ | Defines the autocomplete is active. |
| `showClear` | `boolean` | _not documented_ | When enabled, a clear icon is displayed to clear the value. |
| `autofocus` | `boolean \| undefined` | _not documented_ | When present, it specifies that the component should automatically get focus on load. |
| `placeholder` | `` | _not documented_ | Label to display when there are no selections. |
| `options` | `any[] \| undefined` | _not documented_ | An array of objects to display as the available options. |
| `filterValue` | `string \| undefined \| null` | _not documented_ | When specified, filter displays with this value. |
| `selectAll` | `boolean \| undefined \| null` | _not documented_ | Whether all data is selected. |
| `focusOnHover` | `boolean` | _not documented_ | Indicates whether to focus on options when hovering over them, defaults to optionLabel. |
| `filterFields` | `any[] \| undefined` | _not documented_ | Fields used when filtering the options, defaults to optionLabel. |
| `selectOnFocus` | `boolean` | _not documented_ | Determines if the option will be selected on focus. |
| `autoOptionFocus` | `boolean` | _not documented_ | Whether to focus on the first visible or selected element when the overlay panel is shown. |
| `highlightOnSelect` | `boolean` | _not documented_ | Whether the selected option will be add highlight class. |
| `size` | `'large' \| 'small' \| undefined` | `undefined` | Specifies the size of the component. |
| `variant` | `'filled' \| 'outlined' \| undefined` | `undefined` | Specifies the input variant of the component. |
| `fluid` | `` | `undefined` | Spans 100% width of the container when enabled. |
| `appendTo` | `HTMLElement \| ElementRef \| TemplateRef<any> \| 'self' \| 'body' \| null \| undefined \| any` | `'self'` | Target element to attach the overlay, valid values are "body" or a local ng-template variable of another element (note: use binding with brackets for template variables, e.g. [appendTo]="mydiv" for a div element having #mydiv as variable name). |
| `motionOptions` | `MotionOptions \| undefined` | _not documented_ | The motion options. |

| Output | Type | Description |
| --- | --- | --- |
| `onChange` | `EventEmitter<MultiSelectChangeEvent>` | Callback to invoke when value changes. |
| `onFilter` | `EventEmitter<MultiSelectFilterEvent>` | Callback to invoke when data is filtered. |
| `onFocus` | `EventEmitter<MultiSelectFocusEvent>` | Callback to invoke when multiselect receives focus. |
| `onBlur` | `EventEmitter<MultiSelectBlurEvent>` | Callback to invoke when multiselect loses focus. |
| `onClick` | `EventEmitter<Event>` | Callback to invoke when component is clicked. |
| `onClear` | `EventEmitter<void>` | Callback to invoke when input field is cleared. |
| `onPanelShow` | `EventEmitter<AnimationEvent>` | Callback to invoke when overlay panel becomes visible. |
| `onPanelHide` | `EventEmitter<AnimationEvent>` | Callback to invoke when overlay panel becomes hidden. |
| `onLazyLoad` | `EventEmitter<MultiSelectLazyLoadEvent>` | Callback to invoke in lazy mode to load new data. |
| `onRemove` | `EventEmitter<MultiSelectRemoveEvent>` | Callback to invoke in lazy mode to load new data. |
| `onSelectAllChange` | `EventEmitter<MultiSelectSelectAllChangeEvent>` | Callback to invoke when all data is selected. |

| Slot | Read as | Description |
| --- | --- | --- |
| `<ng-template #item>` | `itemTemplate` | Custom item template. |
| `<ng-template #group>` | `groupTemplate` | Custom group template. |
| `<ng-template #loader>` | `loaderTemplate` | Custom loader template. |
| `<ng-template #header>` | `headerTemplate` | Custom header template. |
| `<ng-template #filter>` | `filterTemplate` | Custom filter template. |
| `<ng-template #footer>` | `footerTemplate` | Custom footer template. |
| `<ng-template #emptyfilter>` | `emptyFilterTemplate` | Custom empty filter template. |
| `<ng-template #empty>` | `emptyTemplate` | Custom empty template. |
| `<ng-template #selecteditems>` | `selectedItemsTemplate` | Custom selected items template. |
| `<ng-template #loadingicon>` | `loadingIconTemplate` | Custom loading icon template. |
| `<ng-template #filtericon>` | `filterIconTemplate` | Custom filter icon template. |
| `<ng-template #removetokenicon>` | `removeTokenIconTemplate` | Custom remove token icon template. |
| `<ng-template #chipicon>` | `chipIconTemplate` | Custom chip icon template. |
| `<ng-template #clearicon>` | `clearIconTemplate` | Custom clear icon template. |
| `<ng-template #dropdownicon>` | `dropdownIconTemplate` | Custom dropdown icon template. |
| `<ng-template #itemcheckboxicon>` | `itemCheckboxIconTemplate` | Custom item checkbox icon template. |
| `<ng-template #headercheckboxicon>` | `headerCheckboxIconTemplate` | Custom header checkbox icon template. |
