MultiSelect
import { MultiSelectModule } from '@anguless/angulux/multiselect';Basic
MultiSelect binds to an array and summarises the selection in its label.
<agl-multiSelect [(ngModel)]="selected" [options]="cities" optionLabel="name" placeholder="Select cities" ariaLabel="Cities" />Chips
Chip display shows each selected item as its own removable chip.
<agl-multiSelect [(ngModel)]="selected" [options]="cities" optionLabel="name" display="chip" placeholder="Select cities" ariaLabel="Cities" />Filter
Filtering searches the properties named by filterBy.
<agl-multiSelect [(ngModel)]="selected" [options]="cities" [filter]="true" filterBy="name" optionLabel="name" placeholder="Select cities" ariaLabel="Cities" ariaFilterLabel="Search cities" />API
Generated from the committed corpus, which check:corpus holds to the built library.
MultiSelectItem
componentli[aglMultiSelectItem]| Input | Type | Default | Description |
|---|---|---|---|
| option | any | not documented | |
| selected | boolean | undefined | not documented | |
| label | string | undefined | not documented | |
| disabled | boolean | undefined | not documented | |
| item | number | undefined | not documented | |
| focused | boolean | undefined | not documented | |
| aria | string | undefined | not documented | |
| aria | string | undefined | not documented | |
| variant | 'outlined' | 'filled' | not documented | |
| template | TemplateRef<MultiSelectItemTemplateContext> | undefined | not documented | |
| check | TemplateRef<MultiSelectItemCheckboxIconTemplateContext> | undefined | not documented | |
| item | TemplateRef<MultiSelectItemCheckboxIconTemplateContext> | undefined | not documented | |
| highlight | boolean | undefined | not documented |
| Output | Type | Description |
|---|---|---|
| on | EventEmitter<any> | |
| on | EventEmitter<any> |
Inherited from BaseComponent
inherited| Input | Type | Default | Description |
|---|---|---|---|
| dt | Object | undefined | undefined | Defines scoped design tokens of the component. |
| unstyled | boolean | undefined | undefined | Indicates whether the component should be rendered without styles. |
| pt | PT | undefined | undefined | Used to pass attributes to DOM elements inside the component. Keys become attributes, and a key that names a DOM property is also assigned to that property. Values the browser would execute go through Angular's sanitizer first, as in a template binding: markup in `innerHTML`, `outerHTML` and `srcdoc`, and URLs in `href`, `src`, `action`, `formaction` and `xlink:href`. To write one of those unsanitized on purpose, pass a `DomSanitizer.bypassSecurityTrustHtml` or `bypassSecurityTrustUrl` value. An `on*` key must be a function, and any other value for it is ignored. Keys themselves are applied as given, so let data from users choose values, never keys. |
| pt | PassThroughOptions | undefined | undefined | Used to configure passthrough(pt) options of the component. |
MultiSelect
componentagl-multiSelect, agl-multiselect, agl-multi-selectMultiSelect 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 |
| aria | string | undefined | not documented | Defines a string that labels the input for accessibility. |
| style deprecated — since v20.0.0, use `class` instead. | string | undefined | not documented | Style class of the element. |
| panel | any | not documented | Inline style of the overlay panel. |
| panel | string | undefined | not documented | Style class of the overlay panel element. |
| input | 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. |
| filter | string | undefined | not documented | Defines placeholder of the filter input. |
| filter | string | undefined | not documented | Locale to use in filtering. The default locale is the host environment's current locale. |
| overlay | boolean | undefined | not documented | Specifies the visibility of the options panel. |
| tabindex | number | undefined | not documented | Index of the element in tabbing order. |
| data | string | undefined | not documented | A property to uniquely identify a value in options. |
| aria | string | undefined | not documented | Establishes relationships between the component and label(s) where its value should be one or more element IDs. |
| display | true | Whether to show labels of selected item labels or use default label. | |
| max | 3 | Decides how many selected item labels to show at most. | |
| selection | number | undefined | not documented | Maximum number of selectable items. |
| selected | 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. |
| show | boolean | not documented | Whether to show the checkbox at header to toggle all items at once. |
| empty | string | not documented | Text to display when filtering does not return any results. |
| empty | string | not documented | Text to display when there is no data. Defaults to global value in i18n translation configuration. |
| reset | boolean | not documented | Clears the filter value when hiding the dropdown. |
| dropdown | string | undefined | not documented | Icon class of the dropdown icon. |
| chip | string | undefined | not documented | Icon class of the chip icon. |
| option | string | undefined | not documented | Name of the label field of an option. |
| option | string | undefined | not documented | Name of the value field of an option. |
| option | string | undefined | not documented | Name of the disabled field of an option. |
| option | string | undefined | not documented | Name of the label field of an option group. |
| option | string | not documented | Name of the options field of an option group. |
| show | boolean | not documented | Whether to show the header. |
| filter | string | undefined | not documented | When filtering is enabled, filterBy decides which field or fields (comma separated) to search against. |
| scroll | 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. |
| virtual | 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. |
| virtual | number | undefined | not documented | Height of an item in the list for VirtualScrolling. |
| loading | string | undefined | not documented | Icon to display in loading state. |
| virtual | ScrollerOptions | undefined | not documented | Whether to use the scroller feature. The properties of scroller component can be used like an object in it. |
| overlay | OverlayOptions | undefined | not documented | Whether to use overlay API feature. The properties of overlay API can be used like an object in it. |
| aria | string | undefined | not documented | Defines a string that labels the filter input. |
| filter | '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. |
| tooltip | 'top' | 'left' | 'right' | 'bottom' | not documented | Position of the tooltip. |
| tooltip | string | not documented | Type of CSS position. |
| tooltip | string | undefined | not documented | Style class of the tooltip. |
| autofocus | 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. |
| show | 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. |
| filter | string | undefined | null | not documented | When specified, filter displays with this value. |
| select | boolean | undefined | null | not documented | Whether all data is selected. |
| focus | boolean | not documented | Indicates whether to focus on options when hovering over them, defaults to optionLabel. |
| filter | any[] | undefined | not documented | Fields used when filtering the options, defaults to optionLabel. |
| select | boolean | not documented | Determines if the option will be selected on focus. |
| auto | boolean | not documented | Whether to focus on the first visible or selected element when the overlay panel is shown. |
| highlight | 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. | |
| append | 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). |
| motion | MotionOptions | undefined | not documented | The motion options. |
| Output | Type | Description |
|---|---|---|
| on | EventEmitter<MultiSelectChangeEvent> | Callback to invoke when value changes. |
| on | EventEmitter<MultiSelectFilterEvent> | Callback to invoke when data is filtered. |
| on | EventEmitter<MultiSelectFocusEvent> | Callback to invoke when multiselect receives focus. |
| on | EventEmitter<MultiSelectBlurEvent> | Callback to invoke when multiselect loses focus. |
| on | EventEmitter<Event> | Callback to invoke when component is clicked. |
| on | EventEmitter<void> | Callback to invoke when input field is cleared. |
| on | EventEmitter<AnimationEvent> | Callback to invoke when overlay panel becomes visible. |
| on | EventEmitter<AnimationEvent> | Callback to invoke when overlay panel becomes hidden. |
| on | EventEmitter<MultiSelectLazyLoadEvent> | Callback to invoke in lazy mode to load new data. |
| on | EventEmitter<MultiSelectRemoveEvent> | Callback to invoke in lazy mode to load new data. |
| on | EventEmitter<MultiSelectSelectAllChangeEvent> | Callback to invoke when all data is selected. |
| Template slot | Description |
|---|---|
| <ng-template #item> | Custom item template. |
| <ng-template #group> | Custom group template. |
| <ng-template #loader> | Custom loader template. |
| <ng-template #header> | Custom header template. |
| <ng-template #filter> | Custom filter template. |
| <ng-template #footer> | Custom footer template. |
| <ng-template #emptyfilter> | Custom empty filter template. |
| <ng-template #empty> | Custom empty template. |
| <ng-template #selecteditems> | Custom selected items template. |
| <ng-template #loadingicon> | Custom loading icon template. |
| <ng-template #filtericon> | Custom filter icon template. |
| <ng-template #removetokenicon> | Custom remove token icon template. |
| <ng-template #chipicon> | Custom chip icon template. |
| <ng-template #clearicon> | Custom clear icon template. |
| <ng-template #dropdownicon> | Custom dropdown icon template. |
| <ng-template #itemcheckboxicon> | Custom item checkbox icon template. |
| <ng-template #headercheckboxicon> | Custom header checkbox icon template. |
Inherited from BaseEditableHolder
inherited| Input | Type | Default | Description |
|---|---|---|---|
| required | false | There must be a value (if set). Left unbound, a control bound through `formControlName`, `[formControl]` or `ngModel` is required when that control carries `Validators.required` or `Validators.requiredTrue`. | |
| invalid | false | When present, it specifies that the component should have invalid state style. Left unbound, a control bound through `formControlName`, `[formControl]` or `ngModel` shows the state of that control once it is touched or dirty. | |
| touched | boolean | undefined | undefined | Whether the user has visited the control. Once this or `dirty` is set, the invalid state style waits for interaction: it appears when the control is touched or dirty. Signal Forms' `[formField]` sets both, so an untouched required field is not shown as invalid. Leave both unset and `invalid` alone decides. |
| dirty | boolean | undefined | undefined | Whether the user has changed the value. See `touched`. |
| disabled | false | When present, it specifies that the component should have disabled state style. | |
| name | string | undefined | undefined | When present, it specifies that the name of the input. |
Inherited from BaseComponent
inherited| Input | Type | Default | Description |
|---|---|---|---|
| dt | Object | undefined | undefined | Defines scoped design tokens of the component. |
| unstyled | boolean | undefined | undefined | Indicates whether the component should be rendered without styles. |
| pt | PT | undefined | undefined | Used to pass attributes to DOM elements inside the component. Keys become attributes, and a key that names a DOM property is also assigned to that property. Values the browser would execute go through Angular's sanitizer first, as in a template binding: markup in `innerHTML`, `outerHTML` and `srcdoc`, and URLs in `href`, `src`, `action`, `formaction` and `xlink:href`. To write one of those unsanitized on purpose, pass a `DomSanitizer.bypassSecurityTrustHtml` or `bypassSecurityTrustUrl` value. An `on*` key must be a function, and any other value for it is ignored. Keys themselves are applied as given, so let data from users choose values, never keys. |
| pt | PassThroughOptions | undefined | undefined | Used to configure passthrough(pt) options of the component. |