Skip to content
OGE logoOGE

Accordion API

Full surface of @oge-ui/layout: the oge-accordion container, the declarative <oge-accordion-item> child with its four template slots, the nested oge-panel-bar, the stand-alone oge-expansion-panel and the config provider.

Properties Methods Events Types

OgeAccordion

oge-accordion

Properties 23

Panels & expansion

Name Type DefaultDescription
itemsreadonly OgeAccordionItemData[] | undefined—Data-driven panels rendered after the projected <oge-accordion-item> children.
expandedKeysreadonly string[][]Keys of the expanded panels — two-way. The multi-expand counterpart of selectedIndex; only panels that declare a key can appear here.
selectedIndexnumber-1Index of the expanded panel in single-expand mode — two-way. -1 means none; in multiple mode it reports the first expanded panel.
multiplebooleanfalseAllows more than one panel to stay expanded.
collapsiblebooleanfalseAllows collapsing the last expanded panel, leaving none open. While false, that header is aria-disabled per the APG — it stays focusable.
disabledbooleanfalseDisables the whole component.

Rendering & animation

Name Type DefaultDescription
deferRenderingbooleantrueInstantiate a panel's content only when it first expands.
keepAlivebooleantrueKeep once-rendered panels mounted (hidden) so their state survives a collapse. Ignored while deferRendering is false.
animationboolean | numbertrueHeight animation: true uses the default duration, a number overrides it in milliseconds, false disables it. Always suppressed under prefers-reduced-motion.

Appearance

Name Type DefaultDescription
togglePosition'start' | 'end''end'Side of the header the chevron sits on — logical, so RTL mirrors it.
hideTogglebooleanfalseHides the chevron entirely. Overridable per panel via <oge-accordion-item [hideToggle]>.
collapsedHeaderHeightstring | undefined—Minimum height of a collapsed header (any CSS length). undefined lets size and the padding tokens decide. Material’s collapsedHeight.
expandedHeaderHeightstring | undefined—Minimum height of an expanded header; falls back to collapsedHeaderHeight. Material’s expandedHeight.
displayMode'default' | 'flat''default'flat removes the gutters between panels and joins them into one stack.
stylingMode'outlined' | 'filled' | 'flat''outlined'Visual variant of the panels.
size'sm' | 'md' | 'lg''md'Density of the header rows.

Keyboard & accessibility

Name Type DefaultDescription
keyboardNavigationbooleantrueEnables Up/Down/Home/End and Ctrl+PageUp/PageDown header navigation. The APG pattern itself requires only Enter/Space and Tab — this is the optional enhancement.
typeAheadbooleantrueEnables printable-character type-ahead over the panel titles. Matching is accent- and locale-insensitive.
selectOnFocusbooleanfalseExpands a panel as soon as keyboard navigation moves focus onto it.
headingLevelnumber3aria-level of the heading wrapping each header button.
useRegionRolebooleantrueGives each panel role="region" (APG-optional; adds one landmark per panel).
ariaLabelstring | undefined—Aria label of the accordion container.
messagesPartial<OgeAccordionMessages>{}Per-instance overrides of the config messages.

Methods 8

Name Type Description
expand(target)(target: number | string) => Promise<boolean>Runs the expand pipeline for the panel at an index or with a key. Resolves true once it expanded, false if an unknown target, itemExpanding or the expandGuard vetoed it.
collapse(target)(target: number | string) => Promise<boolean>Runs the collapse pipeline; resolves whether the panel actually collapsed.
toggle(target)(target: number | string) => Promise<boolean>Expands the panel if collapsed, collapses it otherwise.
expandAll()() => voidExpands every enabled panel. Requires multiple — otherwise it warns in dev mode and does nothing.
collapseAll()() => voidCollapses every panel. In single-expand mode the last panel stays open unless collapsible is set.
expandInvalid()() => voidExpands every panel flagged invalid — call it after a failed form submit so the user sees each section needing attention.
isExpanded(target)(target: number | string) => booleanWhether the panel at an index or with a key is currently expanded.
focus(target?)(target?: number | string) => voidFocuses a panel's header button, or the first enabled one.

Events 11

Name Type Description
itemExpandingOgeAccordionExpandingEventCancelable pre-event of a panel expanding — set cancel = true to block it. Runs before the panel’s expandGuard.
itemExpandedOgeAccordionExpandedEventEmitted after a panel expanded.
itemCollapsingOgeAccordionCollapsingEventCancelable pre-event of a panel collapsing — set cancel = true to block it.
itemCollapsedOgeAccordionCollapsedEventEmitted after a panel collapsed.
afterExpandOgeAccordionExpandedEventEmitted once the expand animation finished — the point at which the panel has its final height. Fires immediately when the animation is off or suppressed by prefers-reduced-motion.
afterCollapseOgeAccordionCollapsedEventEmitted once the collapse animation finished.
itemClickOgeAccordionItemClickEventEmitted when a header button is activated, before the expand pipeline runs. Fires for disabled panels too.
itemContentLoadedOgeAccordionContentLoadedEventEmitted after a panel's contentLoader resolved.
itemContentFailedOgeAccordionContentFailedEventEmitted after a panel's contentLoader rejected.
expandedKeysChangereadonly string[]Two-way model output of expandedKeys.
selectedIndexChangenumberTwo-way model output of selectedIndex.

Types 7

Types

Name Type Description
OgeAccordionItemDatainterfaceData-driven counterpart of a declarative panel: key, title, description, icon, badge, hint, disabled, visible, expanded, invalid, expandGuard, contentLoader.
OgeAccordionExpandGuard() => boolean | Promise<boolean>Veto for a pending expand or collapse. false blocks it; throwing or rejecting is also a veto. While a promise is pending the panel shows a spinner and ignores further toggles (single-flight).
OgeAccordionContentLoader() => Promise<unknown>Loads a panel's content the first time it expands. The resolved value reaches the content template as data.
OgeAccordionTogglePosition'start' | 'end'Chevron side inside the header button.
OgeAccordionDisplayMode'default' | 'flat'Gutters between panels, or one joined stack.
OgeAccordionStylingMode'outlined' | 'filled' | 'flat'Visual variant of the panels.
OgeAccordionSize'sm' | 'md' | 'lg'Density of the header rows.

OgeAccordionItem

oge-accordion-item

Properties 15

Name Type DefaultDescription
titlestring''Header title; alternative to an inline [ogeAccordionHeaderTemplate].
textstring | undefined—Plain-text panel body, rendered when there is no projected content or content template. The reference html item field has no counterpart on purpose.
descriptionstring | undefined—Secondary line rendered under the title.
keystring | undefined—Stable identity used by expandedKeys and DOM ids.
iconstring | undefined—SVG path data (d) rendered as a 24×24 aria-hidden icon before the title.
badgestring | number | undefined—Badge rendered after the title.
hintstring | undefined—Tooltip — rendered as the native title attribute.
disabledbooleanfalseDisabled panels cannot expand and are skipped by keyboard navigation.
visiblebooleantruefalse removes the panel entirely.
expandedbooleanfalseExpanded state of this panel — two-way. Set it to expand on first render, bind it to follow the state, or write to it to drive the panel from outside. Writes still run the pipeline, so a veto reverts the binding.
hideToggleboolean | undefined—Overrides the accordion's hideToggle for this panel.
togglePosition'start' | 'end' | undefined—Overrides the accordion's togglePosition for this panel.
invalidbooleanfalseFlags the section as failing validation — renders the danger rail and feeds expandInvalid().
expandGuardOgeAccordionExpandGuard | undefined—Veto hook run before this panel expands or collapses; may be async (single-flight).
contentLoaderOgeAccordionContentLoader | undefined—Loads this panel's content on first expand, with a skeleton while pending and a retry button on failure.

Methods 3

Name Type Description
open()() => voidExpands this panel. Like a user gesture it runs the accordion’s pipeline, so itemExpanding and expandGuard can still veto it.
close()() => voidCollapses this panel, subject to collapsible and the guards.
toggle()() => voidExpands the panel if collapsed, collapses it otherwise.

Types 5

Template slots

Name Type Description
[ogeAccordionHeaderTemplate]{ $implicit, index, expanded, title, description }Replaces the built-in title/description/icon layout inside the header button. Component-level instances apply to items panels only (queried with descendants: false). Must not contain focusable controls.
[ogeAccordionContentTemplate]{ $implicit, index, data }Panel body; marks the content lazy. data carries the panel's contentLoader result.
[ogeAccordionToggleIconTemplate]{ $implicit: boolean, index }Replaces the chevron. Accordion-level chrome — a component-level instance applies to declarative children too.
[ogeAccordionHeaderActionsTemplate]{ $implicit, index, expanded }Per-panel actions rendered beside the toggle button, never inside it — real focusable controls without a nested-interactive violation.
[ogeAccordionActionRow]directiveMarks a row of buttons at the end of a panel body as its action bar (divider above, actions at the inline end) — the references' action-row slot. Inside the panel, so only reachable while expanded.

OgePanelBar

oge-panel-bar

Properties 10

Name Type DefaultDescription
itemsreadonly OgePanelBarItem[] | undefined—The item tree. An entry with children is an expandable group; one with content (and no children) expands into free content; the rest are selectable leaves. content is plain text — the [ogePanelBarContentTemplate] slot renders anything richer.
expandMode'single' | 'multiple' | 'full''multiple'Kendo's three modes: multiple lets groups open independently, single collapses a group's open siblings, full is single with the open root group filling the host's height (give the host one).
selectedKeystring | undefined—The selected item — two-way ([(selectedKey)]): its key, or its position id (p0-1) when it has none. Announced as aria-current.
expandedKeysreadonly string[] | undefined—Ids (key or position id) of the expanded groups — two-way. The items' own expanded flags seed it once; a consumer write replaces the state.
disabledbooleanfalseDisables the whole panel bar; a disabled item disables its subtree and leaves the Tab sequence.
deferRenderingbooleantrueRender a group's children or content only from its first expand on (kept afterwards); false renders every level up front.
animationboolean | numbertrueHeight animation: true uses the default duration, a number overrides it in milliseconds, false disables it. Suppressed under prefers-reduced-motion.
keyboardNavigationbooleantrueEnables Up/Down/Home/End and Right/Left header navigation.
ariaLabelstring | undefined—Accessible name of the root list.

Keyboard & accessibility

Name Type DefaultDescription
APG disclosure, not treeview——Kendo renders its PanelBar as role="tree", but a tree may own nothing but tree items — and panel bar groups may hold free content. So every header is a real <button> in the Tab sequence (aria-expanded + aria-controls on groups, aria-current on the selected leaf), collapsed groups are inert, and Up/Down/Home/End plus Right/Left (expand-or-enter / collapse-or-parent, mirrored in RTL) are layered on top. Collapsing a group that holds focus hands focus to its header.

Methods 7

Name Type Description
isExpanded(id)(id: string) => booleanWhether the group with this id (key or position id) is expanded.
expand(id)(id: string) => Promise<boolean>Runs the expand pipeline (cancelable pre-event, then commit); resolves whether the group ended up expanded.
collapse(id)(id: string) => Promise<boolean>Runs the collapse pipeline; resolves whether the group ended up collapsed.
toggle(id)(id: string) => Promise<boolean>Expands a collapsed group, collapses an expanded one.
expandAll()() => voidExpands every enabled group. multiple mode only — otherwise a dev-mode warning and a no-op.
collapseAll()() => voidCollapses every expanded group.
focus(id?)(id?: string) => voidFocuses a header by id, or the first enabled one.

Events 8

Name Type Description
itemClickOgePanelBarItemClickEventA header was activated — before it toggles or selects.
itemExpandingOgePanelBarItemExpandingEventCancelable pre-event of a group expanding — set cancel = true to keep it closed.
itemCollapsingOgePanelBarItemCollapsingEventCancelable pre-event of a group collapsing.
itemExpandedOgePanelBarItemToggleEventA group expanded.
itemCollapsedOgePanelBarItemToggleEventA group collapsed — also each sibling a single / full expand closed.
selectionChangedOgePanelBarSelectionChangedEventThe selected item changed through a user click (previousKey included).
selectedKeyChangestring | undefinedThe banana half of [(selectedKey)].
expandedKeysChangereadonly string[] | undefinedThe banana half of [(expandedKeys)].

Types 5

Types

Name Type Description
OgePanelBarIteminterfacekey, title, description, icon (SVG path data), badge, hint, disabled, visible, expanded, selectable (default: leaves only), content and children.
OgePanelBarExpandMode'single' | 'multiple' | 'full'Expansion vocabulary.
OgePanelBarItemClickEvent / OgePanelBarItemExpandingEvent / OgePanelBarItemCollapsingEvent / OgePanelBarItemToggleEvent / OgePanelBarSelectionChangedEventinterfacesPayloads: item, key, level and the originating event; the -ing ones carry a mutable cancel, the selection one previousKey.
[ogePanelBarHeaderTemplate]OgePanelBarHeaderTemplateContextReplaces the header layout inside each button ($implicit item, level, expanded, selected) — no focusable controls.
[ogePanelBarContentTemplate]OgePanelBarContentTemplateContextRenders the body of every content item ($implicit item, level), instantiated on first expand.

OgeExpansionPanel

oge-expansion-panel

Properties 16

Name Type DefaultDescription
titlestring''Header title.
subtitlestring | undefined—Secondary line under the title.
iconstring | undefined—SVG path data (d) rendered as a 24×24 aria-hidden icon before the title.
hintstring | undefined—Native title tooltip of the header button.
expandedbooleanfalseWhether the body is shown — two-way. A consumer write applies directly; user and method toggles run expanding / collapsing and the guard first.
disabledbooleanfalseBlocks toggling; the header stays visible (aria-disabled) but leaves the Tab sequence.
expandGuard() => boolean | Promise<boolean>—Veto run before every toggle — the accordion's expandGuard: false, a throw or a rejection blocks; while a promise is pending the header shows a spinner and ignores clicks.
togglePosition'start' | 'end''end'Side of the header the chevron sits on — logical, so RTL mirrors it.
hideToggleboolean | undefined—Hides the chevron; falls back to the accordion config's hideToggle.
headingLevelnumber3aria-level of the heading wrapping the header button (native h1–h6 where it can).
useRegionRolebooleantrueGives the body role="region" (APG-optional).
animationboolean | numbertrueHeight animation: true uses the default duration, a number overrides it in milliseconds, false disables it. Suppressed under reduced motion.
deferRenderingbooleantrueInstantiate an ogeExpansionPanelContent template only on first expand (kept afterwards). Plain projected content is always instantiated.
stylingMode'outlined' | 'filled' | 'flat''outlined'Visual variant — the accordion's.
size'sm' | 'md' | 'lg''md'Density of the header row — the accordion's.

Keyboard & accessibility

Name Type DefaultDescription
APG disclosure——The title is a <button aria-expanded aria-controls> inside a heading; Enter / Space toggle it natively, the body is role="region" labelled by the header and inert while collapsed. Collapsing a panel that holds focus hands focus back to the header. The pipeline is runOgeExpansionToggle in @oge-ui/behavior, shared with the panel bar.

Methods 5

Name Type Description
isExpanded()() => booleanWhether the panel is expanded — the expanded model’s current value.
expand()() => Promise<boolean>Runs the expand pipeline; resolves whether the panel ended up expanded.
collapse()() => Promise<boolean>Runs the collapse pipeline; resolves whether the panel ended up collapsed.
toggle()() => Promise<boolean>Expands a collapsed panel, collapses an expanded one.
focus()() => voidFocuses the header button.

Events 5

Name Type Description
expandingOgeExpansionPanelExpandingEventCancelable pre-event of an expand — set cancel = true to keep the panel collapsed.
collapsingOgeExpansionPanelCollapsingEventCancelable pre-event of a collapse.
openedOgeExpansionPanelToggleEventThe panel expanded through a user or method toggle — Material's opened, named so it cannot clash with the expanded model. Not fired for a [(expanded)] write.
closedOgeExpansionPanelToggleEventThe panel collapsed through a user or method toggle — Material's closed.
expandedChangebooleanThe banana half of [(expanded)].

Types 4

Types

Name Type Description
OgeExpansionPanelExpandingEvent / OgeExpansionPanelCollapsingEvent{ event?: Event; cancel: boolean }Cancelable pre-event payloads.
OgeExpansionPanelToggleEvent{ event?: Event }Payload of the past-tense events.
[ogeExpansionPanelActions]attributeMarks projected elements as header actions — real buttons rendered beside the toggle.
[ogeExpansionPanelContent]OgeExpansionPanelContentStructural directive marking the body as lazily instantiated (first expand, kept afterwards).

Accordion configuration

Properties 6

OgeAccordionMessages

Name Type DefaultDescription
invalidSectionstring'section has errors'Announced after the title of a panel flagged invalid.
pendingstring'working'Announced while an expandGuard promise is in flight.
loadingContentstring'Loading…'Shown while a panel's contentLoader is running.
contentLoadFailedstring'Could not load this section.'Shown when a panel's contentLoader rejected.
retrystring'Retry'Label of the retry button on a failed content load.
noDatastring'No sections to display'Shown in place of the panels when there are no visible items.

Types 5

Behavioural defaults

Name Type Description
hideToggleboolean | undefinedDefault for the hideToggle input.
collapsedHeaderHeightstring | undefinedDefault for the collapsedHeaderHeight input.
expandedHeaderHeightstring | undefinedDefault for the expandedHeaderHeight input. Together with the two above this is the MAT_EXPANSION_PANEL_DEFAULT_OPTIONS equivalent.
Name Type Description
provideOgeAccordionConfig(config)(config: OgeAccordionConfigInput) => ProviderApplication- or component-scoped defaults; shallow-merges messages over the built-ins.
OGE_ACCORDION_CONFIGInjectionToken<OgeAccordionConfig>The token itself, with a factory default — inject it to read the effective config.