Import
import { type NuiOption, NuiSelect } from '@needless-ui/angular/select';NuiSelect
A button that opens a list of options.
| 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. The list stays open while you pick. |
selectAllInput | boolean | false | With multiple, adds a button that picks or clears every option. |
placeholderInput | string | 'Select…' | Text shown while nothing is chosen. |
labelInput | string | Accessible name, when no <label> names the button. | |
triggerIdInput | string | Id of the button, for <label for>. | |
disabledInput | boolean | false | Disables the select. |
compareWithInput | (a: V, b: V) => boolean | Object.is | Tells whether two values are the same option, for values that are objects. |
virtualInput | boolean | 'auto' | 'auto' | Renders only the rows in view: always, never, or auto past 200 rows. |
openChangeOutput | boolean | Emits when the list opens or closes. | |
showMethod | () => void | Opens the list. | |
hideMethod | () => void | Closes the list. | |
focusMethod | (options?: FocusOptions) => void | Focuses the button. |
Every text it shows or announces is an input too, so you can translate it: selectAllLabel clearAllLabel emptyLabel
NuiOption
One option. The select, the combobox and the command palette all take these.
| Name | Type | Default | Description |
|---|---|---|---|
valueProperty | V | What choosing it sets. Any type. | |
labelProperty | string | The text shown and searched. | |
descriptionProperty | string | Secondary text under the label. | |
groupProperty | string | Options with the same group are listed under that heading, in order. | |
keywordsProperty | string[] | More words the search matches, such as synonyms or codes. | |
disabledProperty | boolean | Shown, but it can’t be chosen. | |
childrenProperty | NuiOption<V>[] | Options one level down, which make the list a tree. |
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. |