Import

import-combobox.ts
import { NuiCombobox, type NuiOption } from '@needless-ui/angular/select';

NuiCombobox

A text field that suggests options as you type.

Selector
nui-combobox
NuiCombobox: Properties
NameTypeDefaultDescription
optionsInputNuiOption<V>[]The options, as NuiOption objects.
valueTwo-wayV | nullnullThe chosen value, or null. Also works with forms.
valuesTwo-wayreadonly V[][]The chosen values, with multiple.
multipleInputbooleanfalseLets several options be chosen, shown as chips.
createInput(text: string) => VMakes a value from typed text. The list then offers to add text that isn’t an option.
filteringInputbooleantrueFilters the options as you type. Turn it off when a server filters them.
loadingInputbooleanfalseShows a loading row while results are on their way.
clearableInputbooleanfalseAdds a button that clears the value, and lets Escape clear it.
placeholderInputstring''Text shown while the field is empty.
labelInputstringAccessible name, when no <label> names the field.
inputIdInputstringId of the text field, for <label for>.
disabledInputbooleanfalseDisables the field.
compareWithInput(a: V, b: V) => booleanObject.isTells whether two values are the same option, for values that are objects.
displayWithInput(value: V) => stringStringText for a value that isn’t among the options, such as one set before they load.
virtualInputboolean | 'auto''auto'Renders only the rows in view: always, never, or auto past 200 rows.
queryChangeOutputstringEmits the text as it’s typed, for a server search.
openChangeOutputbooleanEmits when the list opens or closes.
showMethod() => voidOpens the list.
hideMethod() => voidCloses the list.
clearMethod() => voidClears the value and the text.
focusMethod(options?: FocusOptions) => voidFocuses the text field.

Every text it shows or announces is an input too, so you can translate it: emptyLabel loadingLabel clearLabel toggleLabel chipsLabel removeLabel createLabel

NuiOptionTemplate

Put it on an ng-template inside the component to draw each row yourself. The context holds the option and its row.

Selector
ng-template[nuiOptionTemplate]

NuiOptionText

Draws an option’s label with the matched letters marked, its description and its path, for your own rows.

Selector
[nuiOptionText]
NuiOptionText: Properties
NameTypeDefaultDescription
nuiOptionTextInputNuiOptionRow<V>The row, from the template context.