Select
A field that opens a bottom sheet of options and shows the one the user picks.
Installation
This also adds Bottom Sheet, which holds the options.
Usage
src/app/app.ts
- Tapping the field opens the sheet. Tapping an item selects it and closes the sheet.
- Tapping the dimmed backdrop, or dragging the sheet's handle down, closes it without a change.
- The field shows the selected item's
label, orplaceholderwhen nothing is selected. The selected item has a check mark. - The list scrolls once it's taller than 300 pixels.
With a label
See Label.
Disabled
A disabled select dims and doesn't open.
Open from code
UiSelect has public open(), close() and toggle() methods. Get it with viewChild(UiSelect) and call them from a handler. open() and toggle() do nothing while disabled.
API
UiSelect
UiSelectItem
No outputs.
Related
- Radio Group: show every option on screen
- Bottom Sheet: the panel the options open in
- Dialogs and overlays
