Choice & selection

AppSelect

Pick one value from a known set of options — searchable once the list grows past a handful.

<app-select label="Client" name="client">…</app-select>

<app-select> lets a user pick one value from a known set of options. It collapses the choices into a single control until opened, and turns on a type-to-filter box once the list grows past a handful — so a four-item list and a forty-item list both stay usable.

Its look comes entirely from the shared @webority/theme, and the behaviour lives once in the shared <wui-select> element, so the Razor <app-select> and the React <AppSelect> render and behave identically on every Webority surface.

Menu open motion product-wide via data-wui-menu-motion — pick one, then open the menus below

Playground

Every attribute, live. Each change re-renders the real tag helper on the server, so the markup underneath is the exact call that produced the select above it.

RPG Bhiwadi DC Tata Power Mumbai Adani Green Gujarat L&T Construction
<app-select label="Client" name="pgclient">
    <app-option value="rpg">RPG Bhiwadi DC</app-option>
    <app-option value="tata">Tata Power Mumbai</app-option>
    <app-option value="adani">Adani Green Gujarat</app-option>
    <app-option value="lt">L&T Construction</app-option>
</app-select>
value only seeds the initial selectionThe value control picks what's selected when the page loads; picking a different option in the control itself does not round-trip back into this field — that's client-side state the tag helper does not read.

Basic

A labelled select with a placeholder. Give it the options and a value; it reports the chosen value back on change.

A single-choice select
RPG Bhiwadi DC Tata Power Mumbai Adani Green Gujarat L&T Construction
Show code
<app-select label="Client" name="client" placeholder="Select a client…">
    <app-option value="rpg">RPG Bhiwadi DC</app-option>
    <app-option value="tata">Tata Power Mumbai</app-option>
    <app-option value="adani">Adani Green Gujarat</app-option>
    <app-option value="lt">L&T Construction</app-option>
</app-select>

Searchable

Set searchable to add a type-to-filter box inside the menu. Reach for it once the list runs past about ten options.

Type-to-filter
search-placeholder labels the filter box inside the open menu.
RPG Bhiwadi DC Tata Power Mumbai Adani Green Gujarat L&T Construction
Show code
<app-select label="Client" name="client" searchable
            search-placeholder="Search clients…" placeholder="Select a client…">
    <app-option value="rpg">RPG Bhiwadi DC</app-option>
    <app-option value="tata">Tata Power Mumbai</app-option>
    <app-option value="adani">Adani Green Gujarat</app-option>
    <app-option value="lt">L&T Construction</app-option>
</app-select>
Make it searchable past ~10 optionsUnder a handful of options, a plain select is quickest. Past about ten, add searchable so the user can type-to-find instead of scrolling a long menu.

Clearable

Set clearable to add a ✕ that resets the selection back to empty. It appears only once a value is chosen.

Reset the selection
RPG Bhiwadi DC Tata Power Mumbai Adani Green Gujarat L&T Construction
Show code
<app-select label="Client" name="client" clearable placeholder="Select a client…">
    <app-option value="tata" selected>Tata Power Mumbai</app-option>
    <!-- … -->
</app-select>

Sizes

size takes sm or lg (md is the default), matching AppInput so a select lines up with the text fields beside it in a form row.

Small, medium, large
RPG Bhiwadi DC Tata Power Mumbai
RPG Bhiwadi DC Tata Power Mumbai
RPG Bhiwadi DC Tata Power Mumbai
Show code
<app-select label="Small" name="c" size="sm">…</app-select>
<app-select label="Medium (default)" name="c">…</app-select>
<app-select label="Large" name="c" size="lg">…</app-select>

Leading icon

icon adds a leading Bootstrap Icons glyph inside the control — a quick visual cue for what the select picks (a client, a category, a status).

A select with a leading icon
RPG Bhiwadi DC Tata Power Mumbai Adani Green Gujarat L&T Construction
Show code
<app-select label="Client" name="client" icon="building" placeholder="Select a client…">…</app-select>

Option icons

Give any option an icon (a Bootstrap Icons name) and it renders on that row in the menu — and on the selected value in the control. Great for statuses and categories.

An icon per option
Active Pending Blocked Complete
Show code
<app-select label="Status" name="status">
    <app-option value="active" icon="check-circle">Active</app-option>
    <app-option value="pending" icon="clock" selected>Pending</app-option>
    <!-- … -->
</app-select>

Floating label

Set floating-label to sit the label inside the control as a placeholder; it slides up and shrinks on focus or once a value is chosen.

Label slides up on select
RPG Bhiwadi DC Tata Power Mumbai Adani Green Gujarat L&T Construction
Show code
<app-select label="Client" name="client" floating-label>
    <app-option value="rpg">RPG Bhiwadi DC</app-option>
    <!-- … -->
</app-select>

Custom class & width

The plain class attribute merges onto the field wrapper — reach for it to size the select with a width utility or your own class. No special attribute needed.

Size the select with class
RPG Bhiwadi DC Tata Power Mumbai
RPG Bhiwadi DC Tata Power Mumbai
Show code
<app-select label="Full width" name="c">…</app-select>
<app-select label="Half width" name="c" class="w-50">…</app-select>

Validation

A select carries the same field treatment as the text inputs — a required mark on the label, a hint for guidance, and an error that turns the control red.

Required with an error
RPG Bhiwadi DC Tata Power Mumbai Adani Green Gujarat L&T Construction
Client is required.
Show code
<app-select label="Client" name="client" required error="Client is required.">
    <app-option value="rpg">RPG Bhiwadi DC</app-option>
    <!-- … -->
</app-select>

When to use

Use it when

  • The user picks one value from a known set of roughly 6 or more options.
  • The options are a fixed list you can render up front — statuses, clients, categories.
  • You want a compact control that keeps the choices collapsed until opened.

Reach for something else when

  • There are only 2–5 options and they fit comfortably on screen. → AppRadio
  • The user needs to pick several values at once. → AppMultiSelect
  • The list is large or loaded from the server as the user types. → AppAutocomplete
  • It is a compact single-purpose picker like page size. → AppSelectMini

Best practices

Do
RPG Bhiwadi DC Tata Power Mumbai Adani Green Gujarat L&T Construction
Past ~10 options, searchable turns a long scroll into a quick type-to-find.
Don't
RPG Bhiwadi DC Tata Power Mumbai Adani Green Gujarat L&T Construction
A long, unsearchable list forces the user to scroll and scan every time.
Do
RPG Bhiwadi DC Tata Power Mumbai
A label names the field and the placeholder tells the user what to pick.
Don't
RPG Bhiwadi DC Tata Power Mumbai
No label and a bare 'Select' leave the field's purpose unclear.
Do
RPG Bhiwadi DC Tata Power Mumbai
Choose the client this project belongs to.
A specific error says which choice is missing and why it matters.
Don't
RPG Bhiwadi DC Tata Power Mumbai
Required
'Required' just repeats the asterisk without helping.

Every option

The whole surface of the component, one cell per value — plus the shell states (disabled, required + error) and a long list that exercises the search-select menu's own scroll.

size — sm · (default) · lg

size="sm"
RPG Bhiwadi DC Tata Power Mumbai Adani Green Gujarat L&T Construction
(default)
RPG Bhiwadi DC Tata Power Mumbai Adani Green Gujarat L&T Construction
size="lg"
RPG Bhiwadi DC Tata Power Mumbai Adani Green Gujarat L&T Construction

searchable / clearable

(default)
RPG Bhiwadi DC Tata Power Mumbai Adani Green Gujarat L&T Construction
searchable
RPG Bhiwadi DC Tata Power Mumbai Adani Green Gujarat L&T Construction
clearable (value set)
RPG Bhiwadi DC Tata Power Mumbai Adani Green Gujarat L&T Construction
searchable + clearable
RPG Bhiwadi DC Tata Power Mumbai Adani Green Gujarat L&T Construction

icon — leading control icon vs. per-option icon

icon="building" (control)
RPG Bhiwadi DC Tata Power Mumbai Adani Green Gujarat L&T Construction
per-option icon
Active Pending Blocked Complete

state — disabled · required + error · floating label

disabled
RPG Bhiwadi DC Tata Power Mumbai Adani Green Gujarat L&T Construction
required + error
RPG Bhiwadi DC Tata Power Mumbai Adani Green Gujarat L&T Construction
Client is required.
floating-label + value
RPG Bhiwadi DC Tata Power Mumbai Adani Green Gujarat L&T Construction
floating-label + empty
RPG Bhiwadi DC Tata Power Mumbai Adani Green Gujarat L&T Construction

long list — searchable menu scroll

30 options, searchable
Option 1 Option 2 Option 3 Option 4 Option 5 Option 6 Option 7 Option 8 Option 9 Option 10 Option 11 Option 12 Option 13 Option 14 Option 15 Option 16 Option 17 Option 18 Option 19 Option 20 Option 21 Option 22 Option 23 Option 24 Option 25 Option 26 Option 27 Option 28 Option 29 Option 30
Grouped options and a per-option disabled are not supportedThe shared <wui-select> element reads only value, label and icon per option — there is no group header and no way to mark a single option unselectable. A caller wanting either has to fake it today (a label prefix for grouping, filtering the option out entirely instead of disabling it). Reported as a library gap, not fixed here.

Attributes

AttributeTypeDefaultDescription
labelstring—The field label. Rendered with the field shell.
namestring—Field name the select posts its value under.
placeholderstringSelect...Shown in the control when nothing is selected.
search-placeholderstringSearch...Placeholder for the in-menu search box.
searchableboolfalseAdds a type-to-filter box inside the menu.
clearableboolfalseAdds a ✕ that resets the selection; shown only when a value is set.
sizestring—Control size: sm / lg. Omit for the default (md).
iconstring—Leading Bootstrap Icons glyph inside the control, e.g. building.
prefixstring-A bordered box before the select, e.g. +91. The same shell as <app-input prefix>.
suffixstring-A bordered box after the select, as <app-input suffix>.
floating-labelboolfalseLabel sits inside as a placeholder and slides up on focus/selection.
classstring—Merges onto the field wrapper — e.g. a width utility to size the select.
disabledboolfalseDisables the control.
requiredboolfalseAppends a required mark to the label.
hintstring—Helper text below the control. Hidden while an error is shown.
errorstring—Error message. Turns the control red and replaces the hint.
<app-option> valuestring—The value of an option child. Its label is the inner content.
<app-option> iconstring—Leading Bootstrap Icons glyph for that option, e.g. check-circle.
<app-option> selectedboolfalseMarks that option as initially selected.
helpstring—Info-tip content shown beside the label.
help-labelstringMore informationaria-label for the info-tip button (React helpLabel).
valuestring—The selected option value. With asp-for this comes from the model instead.
aria-labelstring—Explicit accessible name for the control. Wins over the label-derived aria-label — needed for a label-less filter/toolbar select.
aria-labelled-bystring—Forwarded verbatim onto the control (React aria-labelledby).
aria-described-bystring—Forwarded verbatim onto the control (React aria-describedby).
input-classstring—Extra classes on the control itself (the wui-select) — the React className counterpart. The plain class attribute merges onto the .field wrapper instead.