Select
is a form control for selecting a single value from a set of options, similar to the native <select> element. Textfield
: put any number of Icons and Tooltips inside (and control their order and color), modify the size of the textbox and etc. Explore Textfield documentation page for more customization options. tuiItemsHandlersProvider
to override default behavior of all Select
-s below the current DI scope. Use input properties [identityMatcher]
/ [stringify]
/ disabledItemHandler
(from Textfield
) to do the same for the specific Select
only.
[itemContent]
-property. Also, Textfield has [content]
-property to customize appearance of selected option inside textbox. Both properties accept PolymorpheusContent
– it empowers you with extremely large possibilities for customization.
DataListWrapper
is just a helper to solve most popular use cases. Use DataList
for more complex cases when great flexibility is required. DataList documentation page for more customization options. DataList
exposes Option
-directives – it provides you with an opportunity to decide which data type put inside its [value]
. This example demonstrates how every option can be a complex object with any structure but form control contains a single id-property as number
-type.
Form control:777
Select
with virtual scrolling from @angular/cdk/scrolling . Put tuiDropdownMobile="..."
on <tui-textfield />
to enable sheet dialog (instead of default dropdown) with special appearance of options (similar to native controls) for mobile devices .
This example demonstrates different appearances of options for different platforms (using TuiPlatform
directive). By default, it detects ios
/ android
/ web
platforms automatically (by parsing user agent) – it is not required to specify it explicitly.
<select tuiSelect/>
(instead of <input tuiSelect/>
) to enable native browser picker. This example demonstrates how enable this feature for mobile devices only.
tuiAsOptionContent
-utility. <tui-data-list-wrapper [itemContent]="..." />
can be enough for your task.