OGE logoOGE

Overlay API

Complete API reference for @oge-ui/overlay. Note that OgeAnchoredPanel is a plain DI-free class (not a component) and resolvePopupPosition is a pure function — see the demos for the wiring pattern.

Properties Methods Events Types

OgeModal

oge-modal

Properties 27

Content slots (structural directives)

Name Type DefaultDescription
*ogeModalTitleOgeModalTitle—Rich title slot, replacing the plain title text.
*ogeModalHeaderActionsOgeModalHeaderActions—Extra buttons rendered next to ✕. Presses that start here never begin a header drag.
*ogeModalFooterOgeModalFooter—Footer slot; $implicit is a close function whose optional argument becomes closed.result — <div *ogeModalFooter="let close">.
Name Type DefaultDescription
openedmodel&lt;boolean&gt;falseTwo-way open state. Setting it false directly closes without the guard pipeline.
fullScreenmodel&lt;boolean&gt;falseTwo-way full-screen state; size inputs are ignored while true. Driven by the maximize button when shown.
titlestring | undefined—Header text; also the aria-label fallback when the header is hidden.
ariaLabelstring | undefined—Accessible name override for headerless modals.
width / height / minWidth / minHeight / maxWidth / maxHeightnumber | string | undefined—Panel size — numbers are px, strings pass through. Default width min(560px, 100%).
placementOgeModalPlacement'center'Viewport position: centered or pinned near the top edge ('top', command-palette style).
shadingbooleantrueDims the page behind the modal. false keeps the backdrop transparent while staying fully modal.
showCloseButtonbooleantrueShows the header ✕ button.
showMaximizeButtonbooleanfalseShows a maximize/restore toggle in the header, driving fullScreen.
dragEnabledbooleanfalseLets the user drag the panel by its header (viewport-clamped unless dragOutsideBoundary).
dragOutsideBoundarybooleanfalseAllows dragging the panel beyond the viewport edges.
restorePositionbooleantrueResets drag offset and resized size on every reopen.
resizeEnabledbooleanfalseShows a bottom-end resize handle (min 160×120, viewport-capped).
inertBackgroundbooleanfalseMarks everything outside the modal inert while open — opt-in; content appended to body after opening is not covered.
closeOnEscapebooleantrueEscape closes the modal when it is the topmost overlay (popups inside close first).
closeOnBackdropClickbooleantrueA click that starts and ends on the backdrop closes the modal — a text-selection drag released outside never does.
scrollLockbooleantrueLocks body scroll while open (scrollbar-width compensated, ref-counted across stacked modals).
autoFocusOgeModalAutoFocus'first-tabbable'Initial focus target; an [autofocus] element inside the panel always wins.
restoreFocusbooleantrueRestores focus to the opener on close — only when focus would otherwise be lost.
paddingbooleantruefalse makes the body flush for grids and custom layouts.
busybooleanfalseSpinner veil + aria-busy; user-initiated closes are blocked, programmatic close() still works.
closeGuard() =&gt; boolean | Promise&lt;boolean&gt; | undefined—Veto hook run before every pipeline close; may be async (single-flight — see closePending). A rejected promise vetoes with a dev warning.
messagesPartial&lt;OgeOverlayMessages&gt; | undefined—Per-instance message overrides.
closePendingSignal&lt;boolean&gt;—true while an async closeGuard is pending — disable footer actions with it.

Methods 5

Name Type Description
open(): voidvoidOpens the modal.
close(result?: R): voidvoidCloses through the full pipeline (closing → closeGuard); reason 'api', the argument becomes closed.result.
toggle(): voidvoidOpen ⇄ close.
focus(): voidvoidRe-applies the initial-focus resolution. No-op while closed.
toggleFullScreen(): voidvoidSwitches between windowed and full-screen (the maximize button’s action).

Events 4

Name Type Description
openingOgeModalOpeningEventCancelable: fires before the modal opens (any open path). Set cancel = true to keep it closed.
closingOgeModalClosingEventCancelable: fires before any pipeline close (Escape, backdrop, ✕, close()). Set cancel = true to keep the modal open.
closedOgeModalClosedEvent&lt;R&gt;Fires after the modal closed, with the reason and the optional result.
resizeStarted / resizedOgeModalResizeEventFire when a resize gesture starts (starting size) and ends (final size).

Types 9

Name Type Description
OgeModalCloseReason'api' | 'escape' | 'backdrop' | 'closeButton'Why the modal closed.
OgeModalClosingEvent{ reason: OgeModalCloseReason; cancel: boolean }Cancelable pre-close event.
OgeModalClosedEvent&lt;R&gt;{ reason: OgeModalCloseReason; result?: R }Post-close event; result comes from close(result) or the slot close function.
OgeModalAutoFocus'first-tabbable' | 'panel' | stringInitial-focus strategy — a plain string is treated as a CSS selector inside the panel.
OgeModalPlacement'center' | 'top'Where the panel sits in the viewport.
OgeModalOpeningEvent{ cancel: boolean }Cancelable pre-open event.
OgeModalResizeEvent{ width: number; height: number; event: PointerEvent }Payload of the resize outputs.
OgeModalSlotContext{ $implicit: (result?: unknown) =&gt; void }Context of *ogeModalTitle / *ogeModalHeaderActions / *ogeModalFooter; the function closes the modal.
*ogeModalHeaderActionsstructural slotCustom title-bar buttons, rendered between the title and the maximize/✕ buttons; presses here never start a header drag.

OgeModalService

Methods 1

Name Type Description
open&lt;R, D&gt;(content: Type&lt;unknown&gt; | TemplateRef, config?: OgeModalOpenConfig&lt;D&gt;): OgeModalRef&lt;R&gt;OgeModalRef&lt;R&gt;Opens a body-appended modal hosting the component or template — the escape hatch for transformed ancestors and for prompt/confirm flows without a declared <oge-modal>.

Types 3

Name Type Description
OgeModalOpenConfig&lt;D&gt;objectThe declarative inputs minus slots (title, sizing, placement, closeGuard, …) plus data?: D, made available to the content via OGE_MODAL_DATA.
OgeModalRef&lt;R&gt;{ close(result?: R): void; closed: Promise&lt;OgeModalClosedEvent&lt;R&gt;&gt; }Handle of a service-opened modal; content components can inject it to close themselves with a result.
OGE_MODAL_DATAInjectionToken&lt;unknown&gt;The config.data payload, injectable in the content component.

OgeToastService

Properties 19

OgeToastOptions

Name Type DefaultDescription
messagestring (required)—Body text; also the screen-reader announcement.
titlestring | undefined—Optional bold first line above the message.
severityOgeToastSeverity'info'Drives the accent bar, icon and announcement mode.
displayTimenumberconfig toastDisplayTime (4000)Auto-dismiss time in ms.
stickybooleanfalseNever auto-dismisses (loading toasts are implicitly sticky).
closablebooleantrueShows the ✕ button; aria label from messages.toastClose.
closeOnClickbooleanfalseA click anywhere on the toast closes it (reason 'click'); button presses excluded.
progressBarbooleanconfig toastProgressBar (false)Remaining-time bar — freezes exactly in sync with the paused timer.
actionOgeToastAction | undefined—Inline action button; pressing it runs handler and closes with reason 'action'.
positionOgeToastPositionconfig toastPosition ('bottom-end')Region override for this toast.
announceOgeToastAnnounceseverity-derived'assertive' for errors, 'polite' otherwise; 'off' silences.
announceTextstring | undefined—Screen-reader text override — announced instead of title + message, so the visual text can stay short.
iconTemplateRef&lt;void&gt; | undefined—Replaces the severity icon (the loading spinner still wins).
loadingbooleanfalseSpinner instead of the severity icon; implicitly sticky while true.
coalescebooleanconfig toastCoalesceDuplicates (false)Merge with an identical visible toast into one with a live ×N badge (timer restarts, same ref returned).
idstring | undefined—Coalesce key override; defaults to severity+title+message.
cssClassstring | undefined—Extra class(es) on the toast element.
templateTemplateRef&lt;OgeToastSlotContext&gt; | undefined—Replaces the title/message body; $implicit closes the toast, data is in context.
dataD | undefined—Arbitrary payload surfaced in the template context and action event.

Methods 7

OgeToastService

Name Type Description
show&lt;D&gt;(toast: string | OgeToastOptions&lt;D&gt;): OgeToastRef&lt;D&gt;OgeToastRefShows a toast; a bare string becomes an info toast. SSR-safe no-op.
success / info / warning / error(message, options?): OgeToastRefOgeToastRefSeverity sugar for show().
promise&lt;T, D&gt;(promise, options): OgeToastRef&lt;D&gt;OgeToastRefSticky spinner toast that morphs in place when the promise settles; the timer starts then. success/error accept a message or a function returning a message or an update patch.
clear(position?: OgeToastPosition): voidvoidCloses every toast (or one region) with reason 'clear'.

OgeToastRef

Name Type Description
close(): voidvoidCloses the toast (reason 'api').
update(patch: OgeToastUpdate): voidvoidPatches the toast in place; timing changes restart the timer, a changed message re-announces.
closedPromise&lt;OgeToastClosedEvent&gt;Resolves after the toast closed (exit transition included), with the typed reason.

Types 6

Name Type Description
OgeToastSeverity'info' | 'success' | 'warning' | 'error'Toast severity.
OgeToastPosition'top-start' | 'top-center' | 'top-end' | 'bottom-start' | 'bottom-center' | 'bottom-end'Logical, RTL-aware region positions.
OgeToastCloseReason'timeout' | 'closeButton' | 'click' | 'action' | 'api' | 'clear'Why a toast closed.
OgeToastAction&lt;D&gt;{ text: string; handler?: (event: OgeToastActionEvent&lt;D&gt;) =&gt; void }Inline action button.
OgeToastSlotContext&lt;D&gt;{ $implicit: () =&gt; void; data?: D }Context of a template toast body.
Config keystoastPosition · toastDisplayTime · toastMaxVisible · toastProgressBar · toastCoalesceDuplicatesDefaults via provideOgeOverlayConfig(); strings via messages.toastClose/toastRegionLabel/toastCountBadge.

OgeLiveAnnouncer

Methods 2

OgeLiveAnnouncer

Name Type Description
announce(message: string, options?: OgeLiveAnnounceOptions | OgeLivePoliteness): voidvoidSpeaks message through the polite (default) or assertive region. Written after delay ms (default 100) — a newer message to the same region inside that window supersedes it (debounce); the identical message inside a second is dropped; the region clears after clearAfter ms (default 5000) so a repeat is announced again. Empty text and the server are no-ops.
clear(politeness?: OgeLivePoliteness): voidvoidEmpties one region (or both) and drops anything still pending.

Types 4

Name Type Description
inject(OgeLiveAnnouncer)Injectable({ providedIn: 'root' })Service in @oge-ui/overlay — the lowest Angular package the grid, tree list, Gantt, uploader and toast share. A no-op on the server platform.
OgeLivePoliteness'polite' | 'assertive'Which of the two shared regions speaks.
OgeLiveAnnounceOptions{ politeness?: OgeLivePoliteness; delay?: number; clearAfter?: number }delay: 0 writes synchronously — for a caller that already cleared and waited itself (the toast engine).
OgeLiveAnnouncerCore / getOgeLiveAnnouncer(doc?)@oge-ui/behaviorThe framework-free engine both layers wrap: one polite and one assertive visually hidden aria-live region per document (.oge-live-announcer[data-oge-live-announcer], no role, created on the first announcement, never inerted by a modal’s inertBackground). Every OGE announcement — grid, tree list, toast, Gantt, uploader — goes through it; components never render their own live regions.

OgeTooltip

[ogeTooltip]

Properties 5

Name Type DefaultDescription
ogeTooltipstring (required)—Tooltip text. Applied to any element — the host gets aria-describedby pointing at the panel while it is shown.
tooltipPlacementOgePopupPlacement'top'Preferred side; flips and clamps against the viewport like every anchored panel.
tooltipShowDelaynumber | undefined—Hover dwell before showing, in ms. Falls back to tooltipShowDelayMs from the overlay config. Keyboard focus always shows immediately.
tooltipHideDelaynumber | undefined—Grace period after the pointer leaves, in ms; falls back to tooltipHideDelayMs.
tooltipDisabledbooleanfalseSuppresses the tooltip without removing the directive — hides an already open panel.

OgeContextMenu

[ogeContextMenu]

Properties 3

Name Type DefaultDescription
ogeContextMenureadonly OgeMenuItem[] (required)—Items of the menu opened on right-click or Shift+F10. An empty array falls back to the native browser menu.
contextMenuAriaLabelstring | undefined—Accessible name of the menu.
contextMenuDisabledbooleanfalseLeaves the browser menu in charge without removing the directive.

Methods 1

Name Type Description
close(): voidvoidCloses the menu programmatically.

Events 3

Name Type Description
contextMenuItemClickOgeMenuListItemClickEventAn item was activated — same payload as OgeMenuList. The menu closes afterwards and focus returns to the host.
contextMenuOpenedvoidThe menu opened at the pointer (or at the host for Shift+F10).
contextMenuClosedvoidThe menu closed — by selection, Escape, an outside click or a scroll.

OgeMenuList

oge-menu-list

Properties 4

Name Type Description
itemsreadonly OgeMenuItem[] (required)Menu items, separators included.
menuIdstring | undefinedId of the role="menu" element; generated (oge-menu-N) when omitted.
ariaLabelstring | undefinedAccessible name of the menu.
itemTemplateTemplateRef&lt;OgeMenuItemTemplateContext&gt; | undefinedReplaces the default check+text item rendering (icons, badges…).

Methods 1

Name Type Description
focus(position: 'first' | 'last' = 'first'): voidvoidFocuses the menu container and activates the first/last enabled item.

Events 2

Name Type Description
itemClickOgeMenuListItemClickEventAn enabled item was activated (click, Enter or Space). Order: itemClick → item.action?.() → closeRequest.
closeRequestOgeMenuCloseRequestEventThe menu asks its owner to close it; the owner handles focus. Tab does not preventDefault, so the browser keeps tabbing from the owner.

Types 5

Name Type Description
OgeMenuItem&lt;T&gt;{ text: string; value?: T; hint?; disabled?; checked?; icon?; iconClass?; severity?; separator?; action?: () =&gt; void; url?; badge?; shortcut?; items?: readonly OgeMenuItem&lt;T&gt;[] }Canonical menu item of the suite. A defined checked renders menuitemcheckbox; separator: true ignores every other field. icon takes SVG path data and iconClass hooks an icon font — one row with either gives every row an icon column, so labels stay aligned. url renders the row as a real <a href> with role="menuitem" — keyboard activation clicks the link, so preventDefault() in itemClick hands navigation to a router exactly like a pointer click. badge renders a trailing counter pill; shortcut renders a right-aligned accelerator hint and is announced via aria-keyshortcuts (display only — the application owns the binding). items makes the row a submenu parent (trailing chevron, aria-haspopup="menu", aria-expanded): activation or ArrowRight opens a nested oge-menu-list, hover opens after a dwell, and checked/action/url are ignored on it.
OgeMenuItemSeverity'normal' | 'danger'Destructive items render with the danger token.
OgeMenuListItemClickEvent{ item: OgeMenuItem; index: number; event: MouseEvent | KeyboardEvent }Index within the items input (separators included).
OgeMenuCloseRequestEvent{ reason: 'escape' | 'tab' | 'select' | 'back'; event: KeyboardEvent | MouseEvent }Why the menu wants to close. 'back' is a nested submenu returning to its parent item — absorbed by the parent menu, it never reaches the root owner; 'select' and 'tab' chain up so the owner still receives exactly one request.
OgeMenuItemTemplateContext{ $implicit: OgeMenuItem; index: number }Context of itemTemplate.

OgeAnchoredPanel

Properties 15

Members

Name Type DefaultDescription
panelIdstring—Unique id applied to the panel element (oge-popup-N) — wire to aria-controls.
isOpenSignal&lt;boolean&gt;—Open state.
positionSignal&lt;OgeResolvedPopupPosition | null&gt;—null until the first measure after open; hide the panel while null.

OgeAnchoredPanelOptions (constructor)

Name Type DefaultDescription
anchor() =&gt; HTMLElement | null—Anchor element getter (null while not rendered). Required.
panel() =&gt; HTMLElement | null—Panel element getter (null while closed). Required.
placement() =&gt; OgePopupPlacement'bottom-start'Reactive getter — read signals inside so the next update sees changes.
width() =&gt; number | 'anchor' | undefined—Fixed pixel value or 'anchor' to match the anchor width.
offset() =&gt; number | undefined4Main-axis gap between anchor and panel.
viewportPadding() =&gt; number | undefined8Minimum distance kept from viewport edges when clamping.
closeOnOutsidePointerDownbooleantrueClose on document pointerdown outside anchor+panel (capture phase, composedPath-aware).
closeOnEscapebooleantrueClose on Escape — stacked overlays only close the topmost.
restoreFocus() =&gt; void—Restores focus after closes caused by escape/select (only when focus would otherwise be orphaned).
onClosed(reason: OgePopupCloseReason) =&gt; void—Notified after every close with its reason.
anchorRect() =&gt; OgeRect | null—Virtual anchor rectangle used for positioning when it returns a rect — e.g. the pointer location of a context menu.
transientbooleanfalseTransient surfaces (tooltips) skip the Escape stack so an open tooltip never swallows the Escape meant for the popup underneath.

Methods 5

Name Type Description
open(): voidvoidOpens (SSR-safe no-op without window); pushes onto the open-panel stack, adds listeners, measures.
close(reason: OgePopupCloseReason = 'api'): voidvoidCloses, removes listeners, restores focus for escape/select, then calls onClosed(reason).
toggle(): voidvoidOpen ⇄ close.
updatePosition(): voidvoidRe-measures anchor/panel and recomputes the position (rAF-coalesced). Also runs automatically on scroll/resize/panel growth.
destroy(): voidvoidRemoves every listener and pending frame; call from the owner's DestroyRef.onDestroy.

Types 1

Name Type Description
OgePopupCloseReason'api' | 'outside' | 'escape' | 'select' | 'tab' | 'back'Why a panel closed.

OgePopup

oge-popup

Properties 5

Name Type DefaultDescription
panelOgeAnchoredPanel (required)—The anchored-panel model driving id, position and visibility.
adaptive'popup' | 'sheet' | 'fullscreen''popup'Presentation: anchored, a modal full-width bottom sheet, or a full-screen dialog — role="dialog" + aria-modal, titled, with a close button; the shared OgeAdaptiveSheetCore (@oge-ui/behavior) locks scroll, inerts the background, traps Tab, moves focus in (an element marked data-oge-sheet-focus first), restores it, follows visualViewport above the on-screen keyboard and dismisses on a backdrop tap or a swipe down the handle. Popup editors resolve it from their adaptiveMode.
adaptiveTitlestring''Dialog title while adaptive (editors pass their field label).
closeLabelstring''Aria label of the adaptive close button, from the owner's messages catalog.
[ogePopupSheetHeader] / [ogePopupSheetFooter]content attribute—Projected under the adaptive title (a search field) and pinned at the bottom (a Done action); render them only while adaptive.

Methods 2

Adaptive presentation helpers

Name Type Description
ogeAdaptivePresentation(mode, breakpoint, kind?): Signal<OgeAdaptivePresentation>Signal<OgeAdaptivePresentation>Injection-context helper every popup editor uses: 'popup' unless mode() is 'auto' and the viewport is narrower than breakpoint(), then kind ('sheet' default). Bind it to <oge-popup [adaptive]> in your own popup.
ogeAdaptiveViewport(breakpoint): Signal<boolean>Signal<boolean>Whether the viewport is narrower than breakpoint() — follows matchMedia crossings, false during SSR.

Types 1

Name Type Description
&lt;oge-popup&gt;componentPresentational chrome: fixed positioning, popup surface tokens, --oge-z-popup stacking, transparent (via opacity, so the subtree stays focusable) until the first measure. Projects arbitrary content.

resolvePopupPosition

Methods 1

Name Type Description
resolvePopupPosition(req: OgePopupPositionRequest): OgeResolvedPopupPositionOgeResolvedPopupPositionPure anchored-popup placement: preferred side with flip when the opposite side has more room, cross-axis alignment fallback, and a final clamp into the viewport. Coordinates are viewport-relative (position: fixed).

Types 14

OgePopupPositionRequest

Name Type DefaultDescription
anchorOgeRect—Anchor rectangle (viewport-relative). Required.
panel{ width: number; height: number }—Measured panel size. Required.
viewport{ width: number; height: number }—Viewport size. Required.
placementOgePopupPlacement—Preferred placement. Required.
offsetnumber4Gap between anchor and panel on the main axis.
viewportPaddingnumber8Minimum distance kept from viewport edges when clamping.
rtlbooleanfalseResolves logical start/end (and left/right sides) against RTL.

OgeResolvedPopupPosition

Name Type DefaultDescription
top / leftnumber—Viewport-relative — apply with position: fixed.
placementOgePopupPlacement—Logical placement actually used after flipping.
width?number—Panel width when anchor-width matching or a fixed width was requested (set by OgeAnchoredPanel, not by the pure function).

Supporting types

Name Type DefaultDescription
OgePopupPlacement'bottom-start' | 'bottom-end' | 'top-start' | 'top-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end'—Side + cross-axis alignment.
OgePopupSide'top' | 'bottom' | 'left' | 'right'—Main-axis side.
OgePopupAlign'start' | 'end'—Cross-axis alignment.
OgeRect{ top: number; left: number; width: number; height: number }—Structurally compatible with DOMRect.

Overlay configuration

Methods 1

Name Type Description
provideOgeOverlayConfig(config: OgeOverlayConfigInput): ProviderProviderApplication- or component-scoped defaults.

Types 8

OgeOverlayConfig

Name Type DefaultDescription
offsetnumber4Gap between anchor and panel on the main axis.
viewportPaddingnumber8Minimum distance kept from viewport edges when clamping.
typeAheadMsnumber500Idle time after which the menu type-ahead buffer resets.
menuShowDelayMsnumber50Hover dwell time before a submenu parent row opens its submenu.
menuHideDelayMsnumber300Grace period before an open submenu closes after hovering a sibling row — the diagonal-pointer allowance.
tooltipShowDelayMs / tooltipHideDelayMsnumber400 / 100Hover dwell before a tooltip shows (focus shows immediately) and the grace period before it hides.
toastPosition / toastDisplayTime / toastMaxVisible / toastProgressBar / toastCoalesceDuplicatesOgeToastPosition / number / number / boolean / boolean'bottom-end' / 4000 / 5 / false / falseToast defaults.
messagesOgeOverlayMessages—User-facing strings of the modal header buttons and the toast chrome: modalClose, modalMaximize, modalRestore, toastClose, toastRegionLabel, toastCountBadge.

Overlay primitives

Methods 7

Escape stack

Name Type Description
pushOverlay(surface: object): voidvoidRegisters a surface as the new topmost overlay. No-op if it is already in the stack.
removeOverlay(surface: object): voidvoidRemoves a surface from the stack; tolerates surfaces that were never pushed.
isTopOverlay(surface: object): booleanbooleanTrue only for the topmost surface. Gate your Escape handler on this and a popup opened inside a modal or a drawer closes before its host does.

Focus trap

Name Type Description
getTabbableElements(root: HTMLElement): HTMLElement[]HTMLElement[]Tabbable descendants in DOM order. Recomputed per call rather than cached behind sentinel elements, so content added or removed after open is always accounted for.
trapTabKey(event, root, fallback): voidvoidWraps Tab and Shift+Tab inside root. With no tabbable descendants it focuses fallback, so focus can never escape a modal surface.

Scroll lock

Name Type Description
lockBodyScroll(): voidvoidLocks body scroll and compensates for the scrollbar width. Ref-counted, so nested surfaces cannot unlock each other.
unlockBodyScroll(): voidvoidReleases one reference; the last release restores the inline styles exactly as they were.

Notes

  • The overlay config's messages block is minimal — the anchored primitives render no user-facing strings (consumer components own their i18n); only the modal's and the toast's chrome labels live there.
  • Panels reposition (never detach) on capture-phase scroll and resize; a ResizeObserver on the panel handles async content growth.