OGE logoOGE

List View API

Full surface of oge-list-view: its inputs and models, methods, outputs, the four structural template slots and the config provider.

Properties Methods Events Types

OgeListView

oge-list-view

Properties 21

Data

Name Type DefaultDescription
itemsreadonly T[][]The items, in order. The component is generic: T is inferred from the binding, so templates and event payloads are typed.
keyExprstring | ((item: T) => unknown)'id'Field (or function) giving each item’s key — the identity in selectedKeys and every event. Primitive items are their own key.
displayExprstring | ((item: T) => unknown) | undefined—Field (or function) giving the text of the default row, the search and type-ahead.
disabledExprstring | ((item: T) => unknown) | undefined—Field (or function) marking an item disabled: it stays visible with aria-disabled, the keyboard skips it and it never selects.
groupExprstring | ((item: T) => unknown) | undefined—Field (or function) grouping the items (first-appearance order) under sticky headers. Each group is a labelled segment: role="group" with aria-label in a listbox, a listitem holding a labelled nested list otherwise; the visible header is aria-hidden.

Selection

Name Type DefaultDescription
selectionMode'none' | 'single' | 'multiple'config ?? 'none'none renders a role="list" with a roving tab stop; single / multiple an APG listbox whose viewport tracks the active option with aria-activedescendant (aria-multiselectable for multiple).
selectedKeysreadonly OgeListViewKey[] (model)[]Keys of the selected items — two-way. Space toggles, Enter selects (single), Shift+arrows / Shift+Space / Shift+click extend a range, Ctrl+Shift+Home/End select to an edge, Ctrl+A selects all (or none).
showSelectionControlsboolean | undefinedconfig ?? falseDraws an aria-hidden check (multiple) or radio (single) glyph in every row; the state itself is aria-selected.
disabledbooleanfalseDisables the whole list: nothing selects or activates, the search field is disabled, the viewport leaves the Tab order.

Scrolling & paging

Name Type DefaultDescription
heightnumber | string | undefined—Height of the scroll viewport — a number is px, a string any CSS length. A virtualized list without one uses 320px.
virtualScrollboolean | OgeListViewVirtualScrollOptionsfalseWindowed rendering with fixed row heights ({ itemHeight: 44, groupHeaderHeight: 32, overscan: 6 }) on core’s offset tree. Keyboard navigation scrolls the active option into the window first; the header of a group the window starts inside stays pinned.
pageLoadMode'none' | 'button' | 'scroll'config ?? 'none'button renders a Load more button under the list, scroll emits loadMoreRequested when the viewport nears the end (once per page — also when a first page does not fill the viewport). The arrival of the next items is announced politely.
hasMorebooleanfalseWhether more items can be requested; nothing is requested without it.
loadingbooleanfalseShows the loading row under the list, sets aria-busy and holds further requests.

Search, actions & labels

Name Type DefaultDescription
searchEnabledbooleanfalseRenders a labelled search field (with a clear button) above the list; ArrowDown moves into the list, Escape clears. Matching is locale- and accent-insensitive and the result count is announced.
searchExprOgeListViewSearchExpr<T> | undefined—Field(s) the search matches — one expression or an array; default the display text.
searchMode'contains' | 'startsWith'config ?? 'contains'How the search text matches.
searchValuestring (model)''The search text — two-way.
itemActionsreadonly OgeListViewItemAction[][]Per-item actions, revealed by a horizontal swipe on touch (mirrored in RTL) and on hover / focus with a mouse. They are aria-hidden glyphs inside the row (an option cannot hold buttons); the keyboard twin is each action’s shortcut, listed in aria-keyshortcuts and in a shared description.
ariaLabelstring | undefinedmessages.listLabelAccessible name of the list / listbox.
localestring | undefinedconfig ?? LOCALE_IDBCP 47 locale of the announced counts (ICU plurals).

Methods 5

Name Type Description
focus()() => voidMoves focus into the list — the listbox viewport, or the active item of a plain list — and scrolls the active item into view.
scrollToItem(key)(key: OgeListViewKey) => voidScrolls the item with key into view and makes it the active one.
clearSelection()() => voidClears the selection (emits selectionChanged).
selectAll()() => voidSelects every enabled item of a multiple-selection list and announces the count.
clearSearch()() => voidEmpties the search field.

Events 7

Name Type Description
selectedKeysChangereadonly OgeListViewKey[]The banana half of [(selectedKeys)].
searchValueChangestringThe banana half of [(searchValue)].
selectionChangedOgeListViewSelectionChangedEvent<T>The selection changed through a click, a key, a range, Ctrl+A or a method — with the previous, added and removed keys, the item and the originating event.
itemClickOgeListViewItemClickEvent<T>An item was clicked or activated with Enter.
itemActionClickOgeListViewItemActionClickEvent<T>An item action ran — by tap, click or its keyboard shortcut (one event for all three).
loadMoreRequestedOgeListViewLoadMoreEventThe list asks for more items: reason button or scroll, and the itemCount held now (the next page’s offset).
activeItemChangedOgeListViewActiveItemChangedEvent<T>The active (keyboard) item moved.

Types 15

Template slots

Name Type Description
OgeListViewItemTemplate[ogeListViewItemTemplate]Replaces each row’s content. Context OgeListViewItemTemplateContext: $implicit item, index, key, selected, active, disabled, group. Keep it non-interactive — an option cannot hold controls.
OgeListViewGroupTemplate[ogeListViewGroupTemplate]Replaces each sticky header’s text. Context OgeListViewGroupTemplateContext: $implicit group label, count.
OgeListViewEmptyTemplate[ogeListViewEmptyTemplate]Replaces the empty state. Context OgeListViewEmptyTemplateContext: $implicit searching, searchValue.
OgeListViewFooterTemplate[ogeListViewFooterTemplate]Content under the list; replaces the Load more button. Context OgeListViewFooterTemplateContext: $implicit loadMore function, loading, hasMore, itemCount.

Vocabulary

Name Type Description
OgeListViewKeystring | numberIdentity of an item.
OgeListViewExpr / OgeListViewSearchExprstring | ((item: T) => unknown) / one or an arrayField names or reader functions.
OgeListViewSelectionMode'none' | 'single' | 'multiple'Selection union.
OgeListViewPageLoadMode / OgeListViewSearchMode'none' | 'button' | 'scroll' / 'contains' | 'startsWith'Paging and search unions.
OgeListViewItemAction{ key; label; icon?; severity?: 'neutral' | 'accent' | 'success' | 'warning' | 'danger'; shortcut? }A swipe / hover action; icon is SVG path data, shortcut an aria-keyshortcuts value (Delete, Shift+A).
OgeListViewVirtualScrollOptions{ itemHeight?; groupHeaderHeight?; overscan? }Options form of virtualScroll.
OgeListViewSelectionChangedEvent{ selectedKeys; previousKeys; addedKeys; removedKeys; item?; event? }Payload of selectionChanged.
OgeListViewItemClickEvent / OgeListViewActiveItemChangedEvent{ item; key; index; event? }Payloads of itemClick / activeItemChanged.
OgeListViewItemActionClickEvent{ action; item; key; index; event? }Payload of itemActionClick.
OgeListViewLoadMoreEvent{ reason: 'button' | 'scroll'; itemCount }Payload of loadMoreRequested.
OgeListViewActionSeverity'neutral' | 'accent' | 'success' | 'warning' | 'danger'Colour of an action.

Configuration

Properties 2

Name Type Description
provideOgeListViewConfig(config)(config: OgeListViewConfigInput | (() => OgeListViewConfigInput)) => ProviderApplication- or component-scoped defaults for selectionMode, searchMode, showSelectionControls, pageLoadMode, locale and the messages (a function makes it live). Translated in every @oge-ui/locales pack (layout.listView).
OGE_LIST_VIEW_CONFIGInjectionToken<OgeListViewConfig>The token behind provideOgeListViewConfig(), with OGE_DEFAULT_LIST_VIEW_CONFIG as its factory default.

Types 2

Name Type Description
OgeListViewMessagesinterfaceEvery user-facing string: listLabel, searchLabel, searchPlaceholder, clearSearch, loadMore, loading, noData, noResults, the ICU plurals resultsCount / loadedCount / selectedCount over {count}, and itemActions ({actions}). OGE_DEFAULT_LIST_VIEW_MESSAGES is the English catalog.
OgeListViewConfig / OgeListViewConfigInputinterfaceThe config shape and its partial input; OGE_DEFAULT_LIST_VIEW_CONFIG is the resolved default.