Import

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

NuiSelect

A button that opens a list of options.

Selector
nui-select
NuiSelect: 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. The list stays open while you pick.
selectAllInputbooleanfalseWith multiple, adds a button that picks or clears every option.
placeholderInputstring'Select…'Text shown while nothing is chosen.
labelInputstringAccessible name, when no <label> names the button.
triggerIdInputstringId of the button, for <label for>.
disabledInputbooleanfalseDisables the select.
compareWithInput(a: V, b: V) => booleanObject.isTells whether two values are the same option, for values that are objects.
virtualInputboolean | 'auto''auto'Renders only the rows in view: always, never, or auto past 200 rows.
openChangeOutputbooleanEmits when the list opens or closes.
showMethod() => voidOpens the list.
hideMethod() => voidCloses the list.
focusMethod(options?: FocusOptions) => voidFocuses 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.

NuiOption: Properties
NameTypeDefaultDescription
valuePropertyVWhat choosing it sets. Any type.
labelPropertystringThe text shown and searched.
descriptionPropertystringSecondary text under the label.
groupPropertystringOptions with the same group are listed under that heading, in order.
keywordsPropertystring[]More words the search matches, such as synonyms or codes.
disabledPropertybooleanShown, but it can’t be chosen.
childrenPropertyNuiOption<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.

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.