Skip to content
angulux
@anguless/angulux/select

select

2 declarations4 demos
import
import { SelectModule } from '@anguless/angulux/select';

Basic

Select takes an options array; optionLabel names the property to display.

<agl-select [(ngModel)]="selected" [options]="cities" optionLabel="name" placeholder="Select a city" />

Filter

Filtering is enabled with filter, and filterBy chooses which properties are searched.

<agl-select [(ngModel)]="selected" [options]="cities" [filter]="true" filterBy="name" optionLabel="name" placeholder="Select a city" />

Clear

showClear adds a control that returns the value to null.

<agl-select [(ngModel)]="selected" [options]="cities" [showClear]="true" optionLabel="name" placeholder="Select a city" />

Editable

An editable select accepts values that are not in the list.

<agl-select [(ngModel)]="selected" [options]="cities" [editable]="true" placeholder="Select or type" />

API

Generated from the committed corpus, which check:corpus holds to the built library.

SelectItem

componentagl-selectItem
InputTypeDefaultDescription
idstring | undefinednot documented
optionanynot documented
selectedboolean | undefinednot documented
focusedboolean | undefinednot documented
labelstring | undefinednot documented
disabledboolean | undefinednot documented
visibleboolean | undefinednot documented
itemSizenumber | undefinednot documented
ariaPosInsetstring | undefinednot documented
ariaSetSizestring | undefinednot documented
templateTemplateRef<any> | undefinednot documented
checkmarkbooleannot documented
indexnumber | undefinednot documented
scrollerOptionsanynot documented
OutputTypeDescription
onClickEventEmitter<any>
onMouseEnterEventEmitter<any>

Inherited from BaseComponent

inherited
InputTypeDefaultDescription
dtObject | undefined undefined Defines scoped design tokens of the component.
unstyledboolean | undefined undefined Indicates whether the component should be rendered without styles.
ptPT | undefined undefined Used to pass attributes to DOM elements inside the component. TRUSTED INPUT ONLY. Whatever you put here is applied to the DOM as given: keys become attributes, and a key that names a DOM property is assigned to that property directly, with no sanitizer in between. That is what makes the API useful, and it means a value reaching it from a user, a database or a CMS can execute script. Treat it like markup you wrote yourself, not like data you received.
ptOptionsPassThroughOptions | undefined undefined Used to configure passthrough(pt) options of the component.

Select

componentagl-select

Select is used to choose an item from a collection of options.

InputTypeDefaultDescription
idstring | undefinednot documentedUnique identifier of the component
scrollHeightstringnot documentedHeight of the viewport in pixels, a scrollbar is defined if height of list exceeds this value.
filterboolean | undefinednot documentedWhen specified, displays an input field to filter the items on keyup.
panelStyle{ [klass: string]: any } | null | undefinednot documentedInline style of the overlay panel element.
styleClass
deprecated — since v20.0.0, use `class` instead.
string | undefinednot documentedStyle class of the element.
panelStyleClassstring | undefinednot documentedStyle class of the overlay panel element.
readonlyboolean | undefinednot documentedWhen present, it specifies that the component cannot be edited.
editableboolean | undefinednot documentedWhen present, custom value instead of predefined options can be entered using the editable input field.
tabindexnumber | undefinednot documentedIndex of the element in tabbing order.
placeholdernot documentedDefault text to display when no option is selected.
loadingIconstring | undefinednot documentedIcon to display in loading state.
filterPlaceholderstring | undefinednot documentedPlaceholder text to show when filter input is empty.
filterLocalestring | undefinednot documentedLocale to use in filtering. The default locale is the host environment's current locale.
inputIdstring | undefinednot documentedIdentifier of the accessible input element.
dataKeystring | undefinednot documentedA property to uniquely identify a value in options.
filterBystring | undefinednot documentedWhen filtering is enabled, filterBy decides which field or fields (comma separated) to search against.
filterFieldsany[] | undefinednot documentedFields used when filtering the options, defaults to optionLabel.
autofocusboolean | undefinednot documentedWhen present, it specifies that the component should automatically get focus on load.
resetFilterOnHidebooleannot documentedClears the filter value when hiding the select.
checkmarkbooleannot documentedWhether the selected option will be shown with a check mark.
dropdownIconstring | undefinednot documentedIcon class of the select icon.
loadingboolean | undefinednot documentedWhether the select is in loading state.
optionLabelstring | undefinednot documentedName of the label field of an option.
optionValuestring | undefinednot documentedName of the value field of an option.
optionDisabledstring | undefinednot documentedName of the disabled field of an option.
optionGroupLabelstring | undefinednot documentedName of the label field of an option group.
optionGroupChildrenstringnot documentedName of the options field of an option group.
groupboolean | undefinednot documentedWhether to display options as grouped when nested options are provided.
showClearboolean | undefinednot documentedWhen enabled, a clear icon is displayed to clear the value.
emptyFilterMessagestringnot documentedText to display when filtering does not return any results. Defaults to global value in i18n translation configuration.
emptyMessagestringnot documentedText to display when there is no data. Defaults to global value in i18n translation configuration.
lazybooleannot documentedDefines if data is loaded and interacted with in lazy manner.
virtualScrollboolean | undefinednot documentedWhether the data should be loaded on demand during scroll.
virtualScrollItemSizenumber | undefinednot documentedHeight of an item in the list for VirtualScrolling.
virtualScrollOptionsScrollerOptions | undefinednot documentedWhether to use the scroller feature. The properties of scroller component can be used like an object in it.
overlayOptionsOverlayOptions | undefinednot documentedWhether to use overlay API feature. The properties of overlay API can be used like an object in it.
ariaFilterLabelstring | undefinednot documentedDefines a string that labels the filter input.
ariaLabelstring | undefinednot documentedUsed to define a aria label attribute the current element.
ariaLabelledBystring | undefinednot documentedEstablishes relationships between the component and label(s) where its value should be one or more element IDs.
filterMatchMode'contains' | 'startsWith' | 'endsWith' | 'equals' | 'notEquals' | 'in' | 'lt' | 'lte' | 'gt' | 'gte'not documentedDefines how the items are filtered.
tooltipstringnot documentedAdvisory information to display in a tooltip on hover.
tooltipPosition'top' | 'left' | 'right' | 'bottom'not documentedPosition of the tooltip.
tooltipPositionStylestringnot documentedType of CSS position.
tooltipStyleClassstring | undefinednot documentedStyle class of the tooltip.
focusOnHoverbooleannot documentedFields used when filtering the options, defaults to optionLabel.
selectOnFocusbooleannot documentedDetermines if the option will be selected on focus.
autoOptionFocusbooleannot documentedWhether to focus on the first visible or selected element when the overlay panel is shown.
autofocusFilterbooleannot documentedApplies focus to the filter element when the overlay is shown.
filterValuestring | undefined | nullnot documentedWhen specified, filter displays with this value.
optionsany[] | null | undefinednot documentedAn array of objects to display as the available options.
appendToHTMLElement | 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).
motionOptionsMotionOptions | undefinednot documentedThe motion options.
OutputTypeDescription
onChangeEventEmitter<SelectChangeEvent>Callback to invoke when value of select changes.
onFilterEventEmitter<SelectFilterEvent>Callback to invoke when data is filtered.
onFocusEventEmitter<Event>Callback to invoke when select gets focus.
onBlurEventEmitter<Event>Callback to invoke when select loses focus.
onClickEventEmitter<MouseEvent>Callback to invoke when component is clicked.
onShowEventEmitter<AnimationEvent>Callback to invoke when select overlay gets visible.
onHideEventEmitter<AnimationEvent>Callback to invoke when select overlay gets hidden.
onClearEventEmitter<Event>Callback to invoke when select clears the value.
onLazyLoadEventEmitter<SelectLazyLoadEvent>Callback to invoke in lazy mode to load new data.
Template slotDescription
<ng-template #item>Custom item template.
<ng-template #group>Custom group template.
<ng-template #loader>Custom loader template.
<ng-template #selectedItem>Custom selected item 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 #dropdownicon>Custom dropdown icon template.
<ng-template #loadingicon>Custom loading icon template.
<ng-template #clearicon>Custom clear icon template.
<ng-template #filtericon>Custom filter icon template.

Inherited from BaseInput

inherited
InputTypeDefaultDescription
fluid false Spans 100% width of the container when enabled.
variant'filled' | 'outlined' | undefined 'outlined' Specifies the input variant of the component.
size'large' | 'small' | undefined undefined Specifies the size of the component.
inputSizenumber | null | undefined undefined Specifies the visible width of the input element in characters.
patternstring | null | undefined undefined Specifies the value must match the pattern. A list of regular expressions — what Signal Forms binds through `[formField]` — is ignored, because the form validates those itself.
minnumber | null | undefined undefined The value must be greater than or equal to the value. A numeric string is read as a number; anything else that is not a finite number, such as the `Date` limit of a date field, is ignored.
maxnumber | null | undefined undefined The value must be less than or equal to the value. A numeric string is read as a number; anything else that is not a finite number, such as the `Date` limit of a date field, is ignored.
stepnumber | null | undefined undefined Unless the step is set to the any literal, the value must be min + an integral multiple of the step.
minlengthnumber | null | undefined undefined The number of characters (code points) must not be less than the value of the attribute, if non-empty.
maxlengthnumber | null | undefined undefined The number of characters (code points) must not exceed the value of the attribute.

Inherited from BaseEditableHolder

inherited
InputTypeDefaultDescription
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.
touchedboolean | 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.
dirtyboolean | 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.
namestring | undefined undefined When present, it specifies that the name of the input.

Inherited from BaseComponent

inherited
InputTypeDefaultDescription
dtObject | undefined undefined Defines scoped design tokens of the component.
unstyledboolean | undefined undefined Indicates whether the component should be rendered without styles.
ptPT | undefined undefined Used to pass attributes to DOM elements inside the component. TRUSTED INPUT ONLY. Whatever you put here is applied to the DOM as given: keys become attributes, and a key that names a DOM property is assigned to that property directly, with no sanitizer in between. That is what makes the API useful, and it means a value reaching it from a user, a database or a CMS can execute script. Treat it like markup you wrote yourself, not like data you received.
ptOptionsPassThroughOptions | undefined undefined Used to configure passthrough(pt) options of the component.