OGE logoOGE

List Box

A standing, always-open list of options as a form editor — the WAI-ARIA APG listbox (Kendo ListBox, PrimeNG Listbox): one tab stop with aria-activedescendant, arrows / Home / End / PageUp / PageDown and type-ahead, single mode where the selection follows focus and multiple mode with toggles, Shift ranges and Ctrl+A. groupBy renders labelled groups and searchEnabled a filter field.

The list machine is the dropdown editors' select-list core, generalized to an always-open list in @oge-ui/behavior — the very code the React list box runs. Works standalone via [(value)], with Signal Forms via [formField] and with reactive/template forms via formControl/ngModel.

APG listbox single / multiple type-ahead forms

Getting started

Arrows, Home/End and PageUp/PageDown move the active option and select it; typing jumps by prefix (accent-insensitive, so i finds İstanbul). Disabled options are skipped.

single selection follows focus disabledExpr
City
Amsterdam
Ankara
Berlin
Bonn
Hamburg
İstanbul
İzmir
Rotterdam

Value: 3

Multiple selection

selectionMode="multiple" sets aria-multiselectable: Space, Enter and clicks toggle, Shift+arrows and Shift+click extend from the anchor, Ctrl+Shift+Home/End select to an edge, Ctrl+A selects all (again: none). The value is an items-ordered array.

multiple showCheckBoxes Shift ranges Ctrl+A
Cities to visit
Amsterdam
Ankara
Berlin
Bonn
Hamburg
İstanbul
İzmir
Rotterdam

Value: [2,6]

groupBy renders each group as a role="group" labelled by its header; searchEnabled adds a filter field above the list (ArrowDown moves into the list).

groupBy searchEnabled role=group
Office
Amsterdam
Rotterdam
Ankara
İstanbul
İzmir
Berlin
Bonn
Hamburg

Custom templates

The option keeps its role, selection state and check glyph — only the content is yours. The group template receives the label and the option count.

ogeListBoxItemTemplate ogeListBoxGroupTemplate
Cities
Amsterdam selected
Rotterdam
Ankara
İstanbul
İzmir
Berlin
Bonn
Hamburg

Inside a form

A FormValueControl and a ControlValueAccessor: formControl, ngModel and [formField] all bind it. In multiple mode required means at least one option.

formControl Validators.required
Destinations
Amsterdam
Ankara
Berlin
Bonn
Hamburg
İstanbul
İzmir
Rotterdam
Pick at least one

Valid: false