Skip to main content

upp-select

A dropdown select component composed of three sub-components: upp-select-item (the trigger), upp-select-list (the dropdown container), and upp-select-option (individual options). It implements ControlValueAccessor for seamless Angular Reactive Forms integration and can also be used standalone with the Changed output.

When to Use

Use upp-select when the user must pick one value from a list of options. It provides a collapsible dropdown pattern that works well on both desktop and kiosk environments. For free-text entry, use upp-input instead; for multi-line text, use upp-textarea.

Demo

Source Code

<div class="demo-scroll-container">
<upp-scrollable [scrollbar]="'y'">
<div class="demo-content">
<h2>Order Configuration</h2>
<p class="demo-description">Configure shipping and payment using <code>upp-select</code> with FormGroup and standalone modes.</p>

<div class="demo-controls">
<ion-button size="small" (click)="toggleDisabled()">Disabled: {{ isDisabled }}</ion-button>
</div>

<!-- Shipping country (FormGroup) -->
<div class="demo-section" [formGroup]="form">
<h3>Shipping Country</h3>
<div class="demo-field">
<upp-select formControlName="country" [disabled]="isDisabled">
<upp-select-item>
<ion-item lines="none">
<ion-icon name="globe-outline" slot="start"></ion-icon>
<ion-label>{{ selectedCountryLabel }}</ion-label>
</ion-item>
</upp-select-item>
<upp-select-list>
<upp-select-option *ngFor="let country of countries" [value]="country.value">
<ion-item lines="none" button>
<ion-label>{{ country.label }}</ion-label>
</ion-item>
</upp-select-option>
</upp-select-list>
</upp-select>
<span class="demo-label">Selected: {{ form.get('country')?.value }}</span>
</div>
</div>

<!-- Payment method (standalone) -->
<div class="demo-section">
<h3>Payment Method</h3>
<div class="demo-field">
<upp-select [disabled]="isDisabled" (Changed)="onPaymentChanged($event)">
<upp-select-item>
<ion-item lines="none">
<ion-icon name="card-outline" slot="start"></ion-icon>
<ion-label>{{ selectedPaymentLabel }}</ion-label>
</ion-item>
</upp-select-item>
<upp-select-list>
<upp-select-option *ngFor="let method of paymentMethods" [value]="method.value">
<ion-item lines="none" button>
<ion-label>{{ method.label }}</ion-label>
</ion-item>
</upp-select-option>
</upp-select-list>
</upp-select>
<span class="demo-label">Selected: {{ paymentMethod || 'none' }}</span>
</div>
</div>
</div>
</upp-scrollable>
</div>

API Reference

UppSelectComponent (upp-select)

The main select component. Uses content projection to compose the trigger (upp-select-item), the list container (upp-select-list), and individual options (upp-select-option).

Inputs

PropertyTypeDefaultDescription
formControlNamestring''Name of the reactive form control this select binds to.
disabledbooleanfalseWhen true, the select is disabled. Also respects the parent FormGroup disabled state.
valueanynullThe currently selected value (two-way via ControlValueAccessor).

Outputs

EventPayloadDescription
ChangedanyEmitted when the selected value changes.
FocusvoidEmitted when the select gains focus.

Content Projection

SlotComponentDescription
Triggerupp-select-itemThe clickable element that opens/closes the dropdown.
Listupp-select-listThe container that holds the list of options.

UppSelectItemComponent (upp-select-item)

The trigger element for the dropdown. Clicking it toggles the visibility of the associated upp-select-list.

Outputs

EventPayloadDescription
ExpandbooleanEmitted when the item is expanded or collapsed.

UppSelectListComponent (upp-select-list)

The container for upp-select-option elements. It expands/collapses based on the parent upp-select-item state.

Outputs

EventPayloadDescription
SelectanyEmitted when an option within the list is selected.

UppSelectOptionComponent (upp-select-option)

An individual option inside a upp-select-list.

Inputs

PropertyTypeDefaultDescription
valueanynullThe value associated with this option. Passed to the parent on selection.

Outputs

EventPayloadDescription
SelectanyEmitted when this option is selected.