Import
import { NuiCombobox, type NuiOption } from '@needless-ui/angular/select';NuiCombobox
A text field that suggests options as you type.
| Name | Type | Default | Description |
|---|---|---|---|
optionsInput | NuiOption<V>[] | The options, as NuiOption objects. | |
valueTwo-way | V | null | null | The chosen value, or null. Also works with forms. |
valuesTwo-way | readonly V[] | [] | The chosen values, with multiple. |
multipleInput | boolean | false | Lets several options be chosen, shown as chips. |
createInput | (text: string) => V | Makes a value from typed text. The list then offers to add text that isn’t an option. | |
filteringInput | boolean | true | Filters the options as you type. Turn it off when a server filters them. |
loadingInput | boolean | false | Shows a loading row while results are on their way. |
clearableInput | boolean | false | Adds a button that clears the value, and lets Escape clear it. |
placeholderInput | string | '' | Text shown while the field is empty. |
labelInput | string | Accessible name, when no <label> names the field. | |
inputIdInput | string | Id of the text field, for <label for>. | |
disabledInput | boolean | false | Disables the field. |
compareWithInput | (a: V, b: V) => boolean | Object.is | Tells whether two values are the same option, for values that are objects. |
displayWithInput | (value: V) => string | String | Text for a value that isn’t among the options, such as one set before they load. |
virtualInput | boolean | 'auto' | 'auto' | Renders only the rows in view: always, never, or auto past 200 rows. |
queryChangeOutput | string | Emits the text as it’s typed, for a server search. | |
openChangeOutput | boolean | Emits when the list opens or closes. | |
showMethod | () => void | Opens the list. | |
hideMethod | () => void | Closes the list. | |
clearMethod | () => void | Clears the value and the text. | |
focusMethod | (options?: FocusOptions) => void | Focuses 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.
NuiOptionText
Draws an option’s label with the matched letters marked, its description and its path, for your own rows.
| Name | Type | Default | Description |
|---|---|---|---|
nuiOptionTextInput | NuiOptionRow<V> | The row, from the template context. |