Skip to content
OGE logoOGE

Select Box

<oge-select-box> is a drop-down select on the shared field chrome: pick one item from a list, optionally filter it by typing, and bind the committed value with signals, Signal Forms or reactive forms. The popup follows the anchor on scroll, flips when cramped and matches the field width.

WAI-ARIA combobox displayExpr / valueExpr search signal forms

Basic usage

Bind an array of strings and [(value)] — no mapping needed. Open with the mouse, ↓, Enter or by typing a letter (type-ahead).

[(value)]
value: null

Objects map through displayExpr/valueExpr (field name or function). searchEnabled turns the input editable and filters client-side; searchChanged + [loading] are the server-side escape hatch.

displayExpr valueExpr searchEnabled
committed id: null

Grouping & custom values

groupBy (field name or function) groups flat data under headers on the fly — no pre-shaping. acceptCustomValue lets typed text that matches nothing become the value: customItemCreating maps it to an item (sync, async, or null to reject).

groupBy acceptCustomValue customItemCreating
Type a new tag and press Enter

Lazy data

Pass a function as [items] — it runs once on first open; the popup shows a localized loading row while pending and an error row on rejection. selectedItem resolves as soon as the data lands.

items: () => Promise deferred

Remote data

Bind any @oge-ui/core DataSource to [dataSource]: the list asks for pageSize rows at a time as it scrolls (the virtual window — or the keyboard — nearing the loaded end), sends the typed text as searchText after searchTimeout, aborts a superseded request through its AbortSignal and caches each search's pages. byKey() resolves a value no loaded page holds — here the initial customer #1234 of 5,000.

dataSource pageSize byKey AbortSignal
value: 1234 · requests: 0

Templates & cancelable events

groupTemplate, fieldTemplate (paints the closed field over the real input, which keeps its text for assistive technology), headerTemplate and footerTemplate. (opening) / (closing) are cancelable pre-events — set event.cancel = true; closing carries its reason.

groupTemplate fieldTemplate closing cancel

Tag Box — multi-select

<oge-tag-box> is the multi-select sibling: the value is an array of valueExpr results, picks render as removable chips, the popup stays open while selecting (checkbox listbox, aria-multiselectable) and Backspace removes the last chip. imageExpr puts avatars on chips and options; maxDisplayedTags collapses overflow into a +N chip.

value: T[] imageExpr maxDisplayedTags selectionChanged
Angular
Elif KayaMert Demir

Tag Box — select all, custom tags & limits

The tag box speaks the select box's whole vocabulary — groupBy, itemTemplate, lazy items, acceptCustomValue + customItemCreating — and adds a tri-state showSelectAll row (↑ from the first option reaches it), maxSelectedItems with a status message, tagTemplate chips and a +N more overflow chip.

showSelectAll maxSelectedItems acceptCustomValue tagTemplate
#Angular#Nx
Type a new skill and press Enter

Tag Box — compact display

For narrow places — a grid filter cell, a toolbar — displayMode swaps the chips for a single line. 'count' keeps chips up to countThreshold and then shows the localized selectedCount message (“3 selected”, an ICU plural in the locale packs); 'text' joins the labels and cuts them with an ellipsis. Either way the full list is the line's tooltip, screen readers hear the summary through aria-describedby, and Backspace never removes a value that is not visible.

displayMode countThreshold selectedCount
3 selected
Ankara, Berlin, Cairo

Tag Box — remote data

The same [dataSource] contract on the tag box: 2,000 cities paged 30 at a time, server-side search, and chips that stay resolved while the list shows another search.

dataSource virtualScroll

Item states & templates

disabledExpr marks rows non-selectable (skipped by keyboard navigation too). The selected value stays resolvable even while the visible list is filtered.

disabledExpr
Sold-out plans can't be picked

Field chrome

Everything from the shared chrome applies: label modes, sizes, styling modes, clear button, hints, validation subscript and the sm + subscriptSizing=none compact grid-editor shape.

labelMode size stylingMode
Shipping destination

Mobile / adaptive

With adaptiveMode="auto" a viewport narrower than adaptiveBreakpoint (600px) turns the drop-down into a modal bottom sheet — titled with the label, a close button, a search field at the top, 44px rows, safe-area insets, focus trap and swipe-down dismiss — and the date picker into a full-screen dialog. Narrow the window (or open the page on a phone) to try it; the default 'none' keeps existing apps anchored.

adaptiveMode adaptiveBreakpoint

Keyboard & accessibility

The editor implements the WAI-ARIA combobox pattern with aria-activedescendant — DOM focus never leaves the input; the active option is referenced by id and scrolled into view.

  • ↓/↑ open the popup and move the active option (no wrap); Alt+↑ commits and closes.
  • Enter and Space (select-only) commit; Esc closes without committing — pressed again while searching it clears the search text.
  • Home/End jump to the first/last option in select-only mode (they move the caret while searching); PgUp/PgDn jump ten options.
  • Printable characters type-ahead in select-only mode — a repeated character cycles through its matches.