Skip to main content
Neural UIv2.0.0Documentation
View v1 GitHub

Select

Choose one or several options with search, chips and a typed value model.

Category
Forms and selection
Import
@neural-ui/core/select
Selector
neu-select
import { NeuSelectComponent } from '@neural-ui/core/select';

Usage

Use Select for a finite collection of choices. The default single mode stores one value or null; multiple mode stores an array. A disabled option remains visible but cannot be activated.

Use optionLabel, optionValue and optionDisabled for domain objects. Keep stable identifiers as values instead of copying the displayed label into application state.

Signal Forms

Bind FormField to the value-owning control and add required to the form schema. Select a destination, leave the field to mark it touched, and reset it to check both value and validation state. A required marker on its own does not validate your form.

Signal Forms guide

Signal Forms

Value: โ€” ยท Valid: false

Try and configure

Change the settings below and interact with the live control. The preview, current application value and generated template stay together. A disabled destination lets you check that unavailable choices cannot be selected.

Try and configure
Live preview

Generated template: reflects the settings above. Imports and state are in the Code tab.

template.html
<neu-select
  [options]="destinations"
  (openChange)="onOpenChange($event)"
  (filterChange)="onFilterChange($event)"
  [(value)]="destination"
  [searchable]="true"
  [clearable]="true"
  [ariaFilterLabel]="'Search destinations'"
  [emptyMessage]="'No destinations'"
  [floatingLabel]="true"
  [fluid]="true"
  [label]="'Destination'"
  [loadingLabel]="'Loading destinations'"
  [noResultsMessage]="'No matches'"
  [placeholder]="'Choose a destination'"
  [searchPlaceholder]="'Search'"
/>

Value and events

Use one source of truth: [(value)]="destination" or [value]="destination()" with (valueChange)="destination.set($event)". Do not bind both forms at once.

Inputs configure the control. valueChange synchronizes its model; the other Outputs report their documented actions or lifecycle. Requests for suggestions, children or remote windows require the application to supply data.

Accessibility and keyboard

Use a visible label or an accessible name. Test keyboard navigation, disabled options, selection and closing the panel. Custom option templates should keep descriptive text and must not introduce a nested button or another focusable checkbox inside the option.

Key
Action
Tab Moves focus into or out of the control.
ArrowDown / ArrowUp Moves the active option through available options.
Enter Activates the focused option.
Escape Closes the panel without selecting another option.

API

The reference lists the public Inputs, models, Outputs and Templates from the pinned Core package. Click a named type to open its definition. Each applicable Template has an executable example and its actual source.

Inputs

Configure the component with [property]="value". Your application supplies these values; the component does not replace the state you pass in.

Name
Type
Default
Template binding
Description
ariaDescribedBystring | nullnull[ariaDescribedBy]IDs of elements describing the control, separated by spaces.
ariaFilterLabelstring'Filter options'[ariaFilterLabel]Accessible name of the option search field.
ariaLabelstring | nullnull[ariaLabel]Accessible name when no visible label is available.
ariaLabelledBystring | nullnull[ariaLabelledBy]ID of the element that supplies the accessible name.
autocompletestring | nullnull[autocomplete]Native browser autocomplete attribute for the input.
autofocusbooleanfalse[autofocus]Requests focus when the control is initialized.
autofocusFilterbooleanfalse[autofocusFilter]Focuses the search field when the panel opens.
autoOptionFocusbooleantrue[autoOptionFocus]Moves the active option to an available option when the list opens.
checkmarkbooleanfalse[checkmark]Displays a checkmark next to selected options.
clearablebooleanfalse[clearable]Shows a clear action when a value is selected.
clearAllLabelstring'Clear all'[clearAllLabel]Caption for clearing the selected options in the toggle-all scope.
clearAriaLabelstring'Clear selection'[clearAriaLabel]Accessible name of the clear-selection button.
compareWith(left: V, right: V) => booleanObject.isDerived default[compareWith]Comparison function for selected values; use stable domain identity.
dataFirstnumber0[dataFirst]Logical index of the first loaded option in a remote window.
dirtybooleanfalse[dirty]Form state indicating that the user has changed the value.
disabledbooleanfalse[disabled]Disables user interaction; disabled options cannot be selected.
emptyMessagestring'No options available'[emptyMessage]Message displayed when the option collection is empty.
errorMessagestring''[errorMessage]Visible error message associated with the field.
errorsreadonly ValidationError.WithOptionalFieldTree[][][errors]Validation errors supplied by the form or the application.
filterConfigReadonly<NeuOptionFilterConfig<T>>{}[filterConfig]Fields, matching mode, locale and client/server filtering strategy.
filterOptionsReadonly<NeuSelectFilterOptions>{}[filterOptions]Search settings: enabled state, debounce, locale and reset on close.
filterValuestring | nullnull[filterValue]Applied search query. Listen to filterChange when the application controls it.
floatingLabelbooleanfalse[floatingLabel]Displays the label in the floating-label field style.
fluidbooleanfalse[fluid]Makes the control fill its containing width.
focusOnHoverbooleantrue[focusOnHover]Changes the active option when the pointer enters an option.
groupConfigNeuOptionGroupConfig<T, G> | nullnull[groupConfig]Accessors used to read group labels, children and disabled state.
groupsreadonly G[][][groups]Grouped options, with child items configured through groupConfig.
hiddenbooleanfalse[hidden]Hides the control according to the form state.
hintstring''[hint]Help text associated with the field.
idstring | nullnull[id]Identifier of the control host.
inputIdstring | nullnull[inputId]Identifier of the native input for label and accessibility associations.
invalidbooleanfalse[invalid]Displays the invalid state; it does not add a validation rule.
labelstring''[label]Visible field or option label.
lazybooleanfalse[lazy]Uses loaded windows and emits requests for missing option data.
loadingbooleanfalse[loading]Displays the loading state while the application supplies data.
loadingLabelstring'Loading...'[loadingLabel]Message or announcement for loading options.
modeM'single' as MDerived default[mode]Selection mode. The accepted value shape follows the chosen mode.
namestring''[name]Name associated with the native form control.
noResultsMessagestring'No results'[noResultsMessage]Message displayed when filtering produces no matches.
openboolean | undefinedundefined[open]Applied panel visibility; update it in response to openChange for controlled opening.
optionDisabledNeuOptionDisabledAccessor<T> | nullnull[optionDisabled]Field name or function that marks an option as disabled.
optionLabelNeuOptionLabelAccessor<T> | nullnull[optionLabel]Field name or function used to obtain the visible option label.
optionsreadonly T[][][options]Loaded option records. Accessors allow using your own domain objects.
optionValue(option: T) => V(option) => resolveNeuOptionValue<T, V>(option)Derived default[optionValue]Field name or function used to obtain the stored option value.
pendingbooleanfalse[pending]Form state indicating that asynchronous validation is pending.
placeholderstring'Select...'[placeholder]Text shown when the field has no selected value.
readonlybooleanfalse[readonly]Keeps the value readable without allowing the user to change it.
requiredbooleanfalse[required]Marks the field as required; use a form validator to enforce it.
resetFilterOnHidebooleanfalse[resetFilterOnHide]Resets the search query when the panel closes.
scrollHeightstring'240px'[scrollHeight]Maximum height of the option viewport.
searchablebooleanfalse[searchable]Displays the built-in option search field.
searchPlaceholderstring'Search...'[searchPlaceholder]Placeholder for the option search field.
selectAllLabelstring'Select all'[selectAllLabel]Caption for selecting enabled options in the toggle-all scope.
selectionOptionsReadonly<NeuSelectSelectionOptions>{}[selectionOptions]Multiple-selection options: chips, selection limit, label count and toggle-all scope.
selectOnFocusbooleanfalse[selectOnFocus]Selects the option as focus moves, rather than waiting for activation.
sizeNeuSelectSize'md'[size]Visual field size: sm, md or lg.
tabindexnumber0[tabindex]Tab order of the keyboard entry point.
totalItemsnumber | nullnull[totalItems]Logical total option count for remote windows.
touchedbooleanfalse[touched]Form state indicating that the control has been visited.
variantNeuSelectVariant'outline'[variant]Visual field variant: outline or solid.
virtualScrollbooleanfalse[virtualScroll]Renders an option window instead of every option.
virtualScrollBuffernumber3[virtualScrollBuffer]Extra options rendered before and after the visible virtual window.
virtualScrollItemSizenumber | nullnull[virtualScrollItemSize]Measured option row height in pixels for virtual scrolling.
virtualScrollVisibleItemsnumber8[virtualScrollVisibleItems]Number of visible virtual rows.

Models

A model supports [(property)]="signal" or the [property] and (propertyChange) pair. Choose one form, not both.

Name
Type
Default
Template binding
Description
valueNeuSelectionValue<V, M>null as NeuSelectionValue<V, M>Derived default[(value)]Single mode: one value or null. Multiple mode: an array. The application owns the bound model.

Outputs

Listen to an event with (event)="handler($event)". The table explains the data your handler receives and how to use it.

Name
Payload
Template binding
Description
clearedNeuSelectClearedEvent(cleared)="onCleared($event)"Emitted for the explicit clear action; valueChange carries the resulting value.
closedvoid(closed)="onClosed($event)"Emitted after the browser panel closes.
dataRequestNeuOptionDataRequest(dataRequest)="onDataRequest($event)"Requests an option window. The application supplies options, dataFirst and totalItems.
filterChangestring(filterChange)="onFilterChange($event)"User search query. Use it to update a controlled filter or request remote results.
focusEnteredFocusEvent(focusEntered)="onFocusEntered($event)"Emitted when focus enters the control.
focusLeftFocusEvent(focusLeft)="onFocusLeft($event)"Emitted when focus leaves the control.
openChangeboolean(openChange)="onOpenChange($event)"Requested panel visibility; update open when visibility is controlled by the application.
openedvoid(opened)="onOpened($event)"Emitted after the browser panel opens.
optionActivatedNeuOptionActivatedEvent<T, V>(optionActivated)="onOptionActivated($event)"Activated option, its value and the originating event.
touchvoid(touch)="onTouch($event)"Notifies the form that the control has been touched; not a value change.

Templates

ng-content projects content into the component. TemplateRef inputs receive a template; ng-template directives identify templates with a typed context. A directive shared by an entrypoint is not necessarily a slot of this component.

Name
Mechanism
Contract
NeuSelectClearIconDirectiveView example Public template directive (entrypoint)ng-template[neuSelectClearIcon]
NeuSelectDropdownIconDirectiveView example Public template directive (entrypoint)ng-template[neuSelectDropdownIcon]
NeuSelectEmptyDirectiveView example Public template directive (entrypoint)ng-template[neuSelectEmpty]
NeuSelectEmptyFilterDirectiveView example Public template directive (entrypoint)ng-template[neuSelectEmptyFilter]
NeuSelectFilterDirectiveView example Public template directive (entrypoint)ng-template[neuSelectFilter]
NeuSelectFilterIconDirectiveView example Public template directive (entrypoint)ng-template[neuSelectFilterIcon]
NeuSelectFooterDirectiveView example Public template directive (entrypoint)ng-template[neuSelectFooter]
NeuSelectGroupDirectiveView example Public template directive (entrypoint)ng-template[neuSelectGroup]
NeuSelectHeaderDirectiveView example Public template directive (entrypoint)ng-template[neuSelectHeader]
NeuSelectItemDirectiveView example Public template directive (entrypoint)ng-template[neuSelectItem]
NeuSelectLoaderDirectiveView example Public template directive (entrypoint)ng-template[neuSelectLoader]
NeuSelectLoadingIconDirectiveView example Public template directive (entrypoint)ng-template[neuSelectLoadingIcon]
NeuSelectSelectedDirectiveView example Public template directive (entrypoint)ng-template[neuSelectSelected]

Each example demonstrates a different template. Switch between Demo and Code to inspect its implementation, imports and state.

ClearIcon template

NeuSelectClearIconDirective

ClearIcon template

Open the control to see the custom template.

DropdownIcon template

NeuSelectDropdownIconDirective

DropdownIcon template

Open the control to see the custom template.

Empty template

NeuSelectEmptyDirective

Empty template

Open the control to see the empty state.

EmptyFilter template

NeuSelectEmptyFilterDirective

EmptyFilter template

Open the control to see the custom template.

Filter template

NeuSelectFilterDirective

Filter template

Open the control to see the custom template.

FilterIcon template

NeuSelectFilterIconDirective

FilterIcon template

Open the control to see the custom template.

Group template

NeuSelectGroupDirective

Group template

Open the control to see the custom template.

Header template

NeuSelectHeaderDirective

Header template

Open the control to see the custom template.

Item template

NeuSelectItemDirective

Item template

Open the control to see the custom template.

Loader template

NeuSelectLoaderDirective

Loader template

Open the control to see the custom template.

LoadingIcon template

NeuSelectLoadingIconDirective

LoadingIcon template

Open the control to see the custom template.

Selected template

NeuSelectSelectedDirective

Selected template

Open the control to see the custom template.

Public methods

Name
Contract
clearclear(event?: Event): void;
focusfocus(): void;
resetFilterresetFilter(emit?: boolean): void;
selectOptionselectOption(option: T): void;

Public Types

Open a type to inspect its definition and interface fields.

Styles and tokens

Load Core styles once. Use the public tokens below for local customization or a preset for application-wide changes. Keep labels, focus, selected options and disabled states readable in both light and dark themes.

Specific tokens

Token
Purpose
State / variant
Default / source
Fallback
--neu-select-option-height Inherited theme value used by this component Field surface 44pxRoot declarationNo token alias

Shared tokens used

Override these on a local wrapper to affect this example. An override on :root affects other components that use the same token.

Token
Purpose here
Other impact
Default / fallback
--neu-border Normal control and cell borders Shared by other Core consumers; scope the override. rgba(15, 23, 42, 0.08)
--neu-border-hover Control borders on hover Shared by other Core consumers; scope the override. rgba(15, 23, 42, 0.16)
--neu-error Invalid field or danger-action color Shared by other Core consumers; scope the override. #dc2626
--neu-error-text Error text and danger outline/ghost Button text in both themes Shared by other Core consumers; scope the override. #991b1b
--neu-focus-ring Normal keyboard-focus ring Shared by other Core consumers; scope the override. 0 0 0 var(--neu-focus-ring-width) rgba(0, 122, 255, 0.15)
--neu-focus-ring-alpha Opacity of the semantic focus ring Shared by other Core consumers; scope the override. 25%
--neu-focus-ring-width Ring thickness, including invalid focus Shared by other Core consumers; scope the override. 3px
--neu-primary Brand color for active controls and emphasis Shared by other Core consumers; scope the override. #007aff