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-modalProperties 35
Content slots (structural directives)
| Name | Type | Default | Description |
|---|---|---|---|
*ogeModalTitle | OgeModalTitle | — | Rich title slot, replacing the plain title text. |
*ogeModalHeaderActions | OgeModalHeaderActions | — | Extra buttons rendered next to ✕. Presses that start here never begin a header drag. |
*ogeModalFooter | OgeModalFooter | — | Footer slot; $implicit is a close function whose optional argument becomes closed.result — <div *ogeModalFooter="let close">. |
| Name | Type | Default | Description |
|---|---|---|---|
opened | model<boolean> | false | Two-way open state. Setting it false directly closes without the guard pipeline. It still fires closed, with reason: 'api' — only closing and closeGuard are skipped. busy never blocks it. |
fullScreen | model<boolean> | false | Two-way full-screen state; size inputs are ignored while true. Driven by the maximize button when shown. |
title | string | undefined | — | Header text; also the aria-label fallback when the header is hidden. |
ariaLabel | string | undefined | — | Accessible name override for headerless modals. |
width / height / minWidth / minHeight / maxWidth / maxHeight | number | string | undefined | — | Panel size — numbers are px, strings pass through. Default width min(560px, 100%). |
placement | OgeModalPlacement | 'center' | Viewport position: the centre, an edge ('top' — command-palette style — 'bottom', logical 'start' / 'end') or a corner ('top-start' … 'bottom-end'). Logical values mirror in RTL. |
dialogRole | OgeModalRole | 'dialog' | ARIA role of the panel; 'alertdialog' for urgent confirmations (APG alert dialog) — what confirm() / alert() use. |
ariaDescribedBy | string | undefined | — | Id(s) of the element(s) describing the dialog — wired to aria-describedby. |
shading | boolean | true | Dims the page behind the modal. false keeps the backdrop transparent while staying fully modal. |
showCloseButton | boolean | true | Shows the header ✕ button. Hiding it leaves Escape working — set closeOnEscape to false as well for a dialog the user must answer. |
showMaximizeButton | boolean | false | Shows a maximize/restore toggle in the header, driving fullScreen. |
dragEnabled | boolean | false | Lets the user drag the panel by its header (viewport-clamped unless dragOutsideBoundary). |
dragOutsideBoundary | boolean | false | Allows dragging the panel beyond the viewport edges. |
restorePosition | boolean | true | Resets drag offset and resized size on every reopen. |
resizeEnabled | boolean | false | Shows a bottom-end resize handle (min 160×120, viewport-capped). |
inertBackground | boolean | false | Marks everything outside the modal inert while open — opt-in; content appended to body after opening is not covered. |
closeOnEscape | boolean | true | Escape closes the modal when it is the topmost overlay (popups inside close first). |
closeOnBackdropClick | boolean | true | A click that starts and ends on the backdrop closes the modal — a text-selection drag released outside never does. |
scrollLock | boolean | true | Locks body scroll while open (scrollbar-width compensated, ref-counted across stacked modals). |
autoFocus | OgeModalAutoFocus | 'first-tabbable' | Initial focus target; an [autofocus] element inside the panel always wins. false (as on the window) focuses the panel itself and no control — no on-screen keyboard pops up for a first text field. |
restoreFocus | boolean | true | Restores focus to the opener on close — only when focus would otherwise be lost. |
padding | boolean | true | false makes the body flush for grids and custom layouts. |
busy | boolean | false | Spinner veil + aria-busy; user-initiated closes are blocked, programmatic close() still works. |
loading | boolean | false | Spinner veil and aria-busy over the body while content loads — unlike busy, closes still work. |
closeGuard | () => boolean | Promise<boolean> | undefined | — | Veto hook run before every pipeline close; may be async (single-flight — see closePending). A rejected promise vetoes with a dev warning. |
messages | Partial<OgeOverlayMessages> | undefined | — | Per-instance message overrides. |
panelClass | OgeClassValue | undefined | — | Extra classes on the dialog panel, next to oge-modal (string, array or { name: boolean }). |
backdropClass | OgeClassValue | undefined | — | Extra classes on the backdrop layer that wraps the panel. |
bodyClass | OgeClassValue | undefined | — | Extra classes on the body, the container of the projected content. |
bodyStyle | Record<string, string> | undefined | — | Inline styles on the body. |
panelAttributes | OgeHtmlAttributes | undefined | — | Extra attributes on the dialog panel (data-testid…). Filtered by ogeSafeAttributes: event handlers (on*), srcdoc, style, class, script URLs and the attributes the component sets itself are dropped (one dev-mode warning per key). |
closePending | Signal<boolean> | — | true while an async closeGuard is pending — disable footer actions with it. |
Methods 5
| Name | Type | Description |
|---|---|---|
open(): void | void | Opens the modal. |
close(result?: R): void | void | Closes through the full pipeline (closing → closeGuard); reason 'api', the argument becomes closed.result. |
toggle(): void | void | Open ⇄ close. |
focus(): void | void | Re-applies the initial-focus resolution. No-op while closed. |
toggleFullScreen(): void | void | Switches between windowed and full-screen (the maximize button’s action). |
Events 5
| Name | Type | Description |
|---|---|---|
opening | OgeModalOpeningEvent | Cancelable: fires before the modal opens (any open path). Set cancel = true to keep it closed. |
closing | OgeModalClosingEvent | Cancelable: fires before any pipeline close (Escape, backdrop, ✕, close()). Set cancel = true to keep the modal open. |
closeBlocked | OgeModalCloseBlockedEvent | A close did not go through — { reason, blockedBy: 'busy' | 'closing' | 'guard' } says why, so the UI can explain it ("Saving…", "Unsaved changes"). |
closed | OgeModalClosedEvent<R> | Fires after the modal closed, with the reason and the optional result. |
resizeStarted / resized | OgeModalResizeEvent | Fire when a resize gesture starts (starting size) and ends (final size). |
Types 10
| Name | Type | Description |
|---|---|---|
OgeModalCloseReason | 'api' | 'escape' | 'backdrop' | 'closeButton' | Why the modal closed. |
OgeModalClosingEvent | { reason: OgeModalCloseReason; cancel: boolean } | Cancelable pre-close event. |
OgeModalClosedEvent<R> | { reason: OgeModalCloseReason; result?: R } | Post-close event; result comes from close(result) or the slot close function. |
OgeModalAutoFocus | 'first-tabbable' | 'panel' | string | Initial-focus strategy — a plain string is treated as a CSS selector inside the panel. |
OgeModalPlacement | 'center' | 'top' | 'bottom' | 'start' | 'end' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | Where the panel sits in the viewport; start / end are logical (mirror in RTL). |
OgeModalRole | 'dialog' | 'alertdialog' | ARIA role of the modal panel. |
OgeModalOpeningEvent | { cancel: boolean } | Cancelable pre-open event. |
OgeModalResizeEvent | { width: number; height: number; event: PointerEvent } | Payload of the resize outputs. |
OgeModalSlotContext | { $implicit: (result?: unknown) => void } | Context of *ogeModalTitle / *ogeModalHeaderActions / *ogeModalFooter; the function closes the modal. |
*ogeModalHeaderActions | structural slot | Custom title-bar buttons, rendered between the title and the maximize/✕ buttons; presses here never start a header drag. |
OgeModalService
Methods 4
| Name | Type | Description |
|---|---|---|
open<R, D>(content: Type<unknown> | TemplateRef, config?: OgeModalOpenConfig<D>): OgeModalRef<R> | OgeModalRef<R> | 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>. |
confirm(options: string | OgeConfirmOptions): Promise<boolean> | Promise<boolean> | Asks a yes/no question in an APG alert dialog (role="alertdialog", described by the message): true for the primary button, false for Cancel and Escape. danger (default: severity === 'danger') styles the primary button as destructive and moves the initial focus to Cancel; otherwise the primary button has it. A string argument is the message. |
alert(options: string | OgeAlertOptions): Promise<void> | Promise<void> | Shows a message with a single OK button (APG alert dialog); Escape acknowledges it too. |
prompt(options: string | OgePromptOptions): Promise<string | null> | Promise<string | null> | Asks for a line of text: the submitted value, or null for Cancel and Escape. The field has the initial focus and Enter submits unless invalid; required and validate (sync or async — OK waits, latest call wins) render the error beside the field with aria-invalid + aria-describedby and announce it. |
Types 9
| Name | Type | Description |
|---|---|---|
OgeModalOpenConfig<D> | object | The declarative inputs minus slots (title, sizing, placement, closeGuard, …) plus data?: D, made available to the content via OGE_MODAL_DATA. Part styling: panelClass, backdropClass, bodyClass, bodyStyle, panelAttributes (as on the modal). |
OgeModalRef<R> | { close(result?: R): void; closed: Promise<OgeModalClosedEvent<R>> } | Handle of a service-opened modal; content components can inject it to close themselves with a result. |
OGE_MODAL_DATA | InjectionToken<unknown> | The config.data payload, injectable in the content component. |
OgeConfirmOptions | { title?; message?; severity?; icon?; okText?; cancelText?; danger?; details?; typeToConfirm?; acknowledgeLabel?; canAccept?; width?; panelClass?; backdropClass?; panelAttributes? } | Options of confirm(). title defaults to the localized dialogConfirmTitle, okText / cancelText to dialogOk / dialogCancel; icon: false hides the severity icon, a TemplateRef replaces it; width defaults to 400. Gates of an irreversible action: details (a text, or a list shown as bullets), typeToConfirm (text the user must type exactly; the field is labelled by the localized dialogTypeToConfirm), acknowledgeLabel (a checkbox to tick) and canAccept(state) (your own rule) — the primary button stays disabled until all pass. |
OgeAlertOptions | { title?; message?; severity?; icon?; okText?; width?; panelClass?; backdropClass?; panelAttributes? } | Options of alert() (no Cancel button; the title defaults to dialogAlertTitle). Every dialog helper also takes the modal part options panelClass, backdropClass and panelAttributes (filtered; the dialog keeps its own role). |
OgePromptOptions | OgeConfirmOptions & { defaultValue?; placeholder?; label?; inputType?; required?; validate? } | Options of prompt(): the field’s initial text, placeholder, visible label (without one the field is labelled by the message or title), native type, the required rule (dialogRequired message) and the custom validator; the title defaults to dialogPromptTitle. |
OgeDialogSeverity | 'info' | 'success' | 'warning' | 'danger' | Tone of a helper dialog — picks the built-in icon and its colour. |
OgePromptInputType | 'text' | 'password' | 'email' | 'number' | 'tel' | 'url' | 'search' | Native type of the prompt field. |
OgePromptValidator | (value: string) => string | null | Promise<string | null> | Return an error message to block the submit, null to accept; a rejected promise blocks without a message. |
OgeWindow
oge-windowProperties 21
| Name | Type | Default | Description |
|---|---|---|---|
opened | model<boolean> | false | Two-way open state. Setting it false directly closes without the closing event. |
state | model<OgeWindowState> | 'normal' | Two-way display state: 'normal', 'minimized' (title bar only) or 'maximized' (fills the viewport). An outside write runs the cancelable pipeline. |
title | string | undefined | — | Title-bar text; also the accessible name (aria-labelledby). |
ariaLabel | string | undefined | — | Accessible name when there is no title. |
position | OgeWindowPosition | null | undefined | — | Explicit top-left corner ({ x, y } in viewport px, x = left edge in both directions); wins over placement and moves the open window when it changes. |
placement | OgeWindowPlacement | 'center' | Where the window opens without a position — the modal’s nine placements, RTL-aware. A new placement re-places an open window; a reopened window otherwise keeps its last box. |
width / height | number | string | undefined | — | Initial size — numbers are px, strings pass through. Default width min(420px, 100vw - 32px), height from the content. A user resize wins. |
minWidth / minHeight | number | undefined | 200 / 120 | Smallest size (px) a resize may reach. |
maxWidth / maxHeight | number | undefined | — | Largest size (px); default the viewport. |
zIndex | number | undefined | — | Base z-index; the window’s stacking layer is added to it. Default: calc(var(--oge-z-window) + layer) — below anchored popups and modals. |
draggable | boolean | true | The title bar drags the window (shared pointer gesture; Escape mid-drag puts it back) and the arrow keys move the focused frame. |
resizable | boolean | true | Eight edge/corner handles resize the window; Ctrl/⌘ + arrows on the focused frame are the keyboard twin. |
keepInViewport | boolean | true | Keeps the whole window on screen; false lets it hang off the sides and bottom while 48px of the title bar stay reachable. A viewport resize re-clamps. |
showMinimizeButton | boolean | true | Shows the minimize / restore title-bar button. |
showMaximizeButton | boolean | true | Shows the maximize / restore title-bar button; a title-bar double-click toggles too. |
showCloseButton | boolean | true | Shows the ✕ title-bar button. |
closeOnEscape | boolean | true | Escape closes the window while focus is inside it and no popup or modal is open. Windows never join the modal Escape stack. |
autoFocus | OgeWindowAutoFocus | 'first-tabbable' | Where focus lands on open — resolved in the body (never on the title-bar buttons), falling back to the frame; false leaves focus alone. |
restoreFocus | boolean | true | Restores focus to the opener on close — only when focus would otherwise be lost. |
padding | boolean | true | false makes the body flush. |
messages | Partial<OgeOverlayMessages> | undefined | — | Per-instance message overrides (button labels windowMinimize / modalMaximize / modalRestore / modalClose, announcements windowMoved / windowResized). |
Methods 11
| Name | Type | Description |
|---|---|---|
open(): void | void | Opens the window. |
close(): void | void | Closes through the cancelable closing event; reason 'api'. |
toggle(): void | void | Open ⇄ close. |
minimize(): boolean | boolean | Collapses the window to its title bar; false when vetoed. |
maximize(): boolean | boolean | Fills the viewport (inside the safe-area insets); false when vetoed. |
restore(): boolean | boolean | Back to the normal box; false when vetoed or already normal. |
bringToFront(): void | void | Raises the window above the other open windows (a press or focus does it too). |
center(): void | void | Re-centres the window in the viewport and fires the moved event. |
moveTo(x: number, y: number): void | void | Moves the top-left corner (clamped) and fires the moved event with source 'api'. |
resizeTo(width: number, height: number): void | void | Resizes (min/max-limited, top-left fixed) and fires the resized event. |
focus(): void | void | Moves focus into the window (the autoFocus resolution). |
Events 8
| Name | Type | Description |
|---|---|---|
opening | OgeWindowOpeningEvent | Cancelable: fires before the window opens (any open path). |
closing | OgeWindowClosingEvent | Cancelable: fires before Escape / ✕ / close() closes the window, with the reason. |
closed | OgeWindowClosedEvent | Fires after the window closed, with the reason. |
moved | OgeWindowMovedEvent | Fires after a drag, a keyboard move, center(), moveTo() or a position / placement change — new x/y and the source ('pointer' | 'keyboard' | 'api'). |
resized | OgeWindowResizedEvent | Fires after a resize gesture (with the edge), a keyboard resize or resizeTo(). |
stateChanging | OgeWindowStateChangingEvent | Cancelable: fires before minimize / maximize / restore (buttons, double-click, Alt+↑/↓, the state binding, methods). |
stateChanged | OgeWindowStateChangedEvent | Fires after the display state changed. |
activated | void | Fires when the window becomes the frontmost (active) one. |
Types 12
| Name | Type | Description |
|---|---|---|
OgeWindowState | 'normal' | 'minimized' | 'maximized' | Display state. |
OgeWindowPlacement | OgeModalPlacement | The modal's placements: 'center', edges and corners. |
OgeWindowPosition | { x: number; y: number } | Top-left corner in viewport px. |
OgeWindowAutoFocus | OgeModalAutoFocus | false | Initial-focus strategy; false leaves focus where it is. |
OgeWindowCloseReason | 'api' | 'escape' | 'closeButton' | Why the window closed. |
OgeWindowMovedEvent | { x; y; source: 'pointer' | 'keyboard' | 'api'; event? } | Payload of the moved event. |
OgeWindowResizedEvent | { width; height; edge?: OgeWindowResizeEdge; source; event? } | Payload of the resized event. |
OgeWindowResizeEdge | 'n' | 's' | 'e' | 'w' | 'ne' | 'nw' | 'se' | 'sw' | The eight resize handles (physical compass edges). |
OgeWindowStateChangingEvent | { state; previousState; cancel: boolean } | Cancelable pre-state-change event. |
OgeWindowStateChangedEvent | { state; previousState } | Post-state-change event. |
OgeWindowOpeningEvent / OgeWindowClosingEvent / OgeWindowClosedEvent | { cancel } / { reason; cancel } / { reason } | Open/close pipeline payloads. |
Keyboard (focused frame) | aria-keyshortcuts | Arrows move 10px, Ctrl/⌘ + arrows resize, Shift = 1px steps, Alt+↑ maximize (or restore from minimized), Alt+↓ minimize (or restore from maximized), Escape closes (focus inside, no popup open). Moves and resizes are announced politely. |
OgeToastService
Properties 19
OgeToastOptions
| Name | Type | Default | Description |
|---|---|---|---|
message | string (required) | — | Body text; also the screen-reader announcement. |
title | string | undefined | — | Optional bold first line above the message. |
severity | OgeToastSeverity | 'info' | Drives the accent bar, icon and announcement mode. |
displayTime | number | config toastDisplayTime (4000) | Auto-dismiss time in ms. |
sticky | boolean | false | Never auto-dismisses (loading toasts are implicitly sticky). |
closable | boolean | true | Shows the ✕ button; aria label from messages.toastClose. |
closeOnClick | boolean | false | A click anywhere on the toast closes it (reason 'click'); button presses excluded. |
progressBar | boolean | config toastProgressBar (false) | Remaining-time bar — freezes exactly in sync with the paused timer. |
action | OgeToastAction | undefined | — | Inline action button; pressing it runs handler and closes with reason 'action'. |
position | OgeToastPosition | config toastPosition ('bottom-end') | Region override for this toast. |
announce | OgeToastAnnounce | severity-derived | 'assertive' for errors, 'polite' otherwise; 'off' silences. |
announceText | string | undefined | — | Screen-reader text override — announced instead of title + message, so the visual text can stay short. |
icon | TemplateRef<void> | undefined | — | Replaces the severity icon (the loading spinner still wins). |
loading | boolean | false | Spinner instead of the severity icon; implicitly sticky while true. |
coalesce | boolean | config toastCoalesceDuplicates (false) | Merge with an identical visible toast into one with a live ×N badge (timer restarts, same ref returned). |
id | string | undefined | — | Coalesce key override; defaults to severity+title+message. |
cssClass | string | undefined | — | Extra class(es) on the toast element. |
template | TemplateRef<OgeToastSlotContext> | undefined | — | Replaces the title/message body; $implicit closes the toast, data is in context. |
data | D | undefined | — | Arbitrary payload surfaced in the template context and action event. |
Methods 7
OgeToastService
| Name | Type | Description |
|---|---|---|
show<D>(toast: string | OgeToastOptions<D>): OgeToastRef<D> | OgeToastRef | Shows a toast; a bare string becomes an info toast. SSR-safe no-op. |
success / info / warning / error(message, options?): OgeToastRef | OgeToastRef | Severity sugar for show(). |
promise<T, D>(promise, options): OgeToastRef<D> | OgeToastRef | Sticky 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): void | void | Closes every toast (or one region) with reason 'clear'. |
OgeToastRef
| Name | Type | Description |
|---|---|---|
close(): void | void | Closes the toast (reason 'api'). |
update(patch: OgeToastUpdate): void | void | Patches the toast in place; timing changes restart the timer, a changed message re-announces. |
closed | Promise<OgeToastClosedEvent> | 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' | 'swipe' | Why a toast closed — 'swipe' when stack mode's swipe-to-dismiss sent it away. |
OgeToastAction<D> | { text: string; handler?: (event: OgeToastActionEvent<D>) => void } | Inline action button. |
OgeToastSlotContext<D> | { $implicit: () => void; data?: D } | Context of a template toast body. |
Config keys | toastPosition · toastDisplayTime · toastMaxVisible · toastProgressBar · toastCoalesceDuplicates · toastStacked | Defaults via provideOgeOverlayConfig(); strings via messages.toastClose/toastRegionLabel/toastCountBadge. |
OgeLiveAnnouncer
Methods 2
OgeLiveAnnouncer
| Name | Type | Description |
|---|---|---|
announce(message: string, options?: OgeLiveAnnounceOptions | OgeLivePoliteness): void | void | Speaks 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): void | void | Empties 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/behavior | The 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. |
OgePopover
oge-popoverProperties 27
Trigger & content slots
| Name | Type | Default | Description |
|---|---|---|---|
[ogePopover] | OgePopoverTrigger — input: OgePopover (required) | — | Trigger directive: <button [ogePopover]="pop"> opens the <oge-popover #pop> per its showOn and carries the trigger ARIA (aria-haspopup="dialog" for click / manual, aria-expanded, aria-controls while open) on its focusable control — the inner <button> of an oge-button. Several triggers may share one popover; the panel anchors to the one that opened it. |
*ogePopoverTitle | OgePopoverTitle | — | Rich title slot, replacing the plain title text (still labels the dialog). Context: OgePopoverSlotContext. |
*ogePopoverFooter | OgePopoverFooter | — | Footer (actions) bar; $implicit closes the popover with reason closeButton — <div *ogePopoverFooter="let close">. |
ogePopoverContent | OgePopoverContent | — | Lazy body: <ng-template ogePopoverContent let-close> is instantiated only while the popover is open and destroyed on close. Projected <ng-content> children are created with the host even while closed, so put heavy content here. |
| Name | Type | Default | Description |
|---|---|---|---|
visible | model<boolean> | false | Two-way open state ([(visible)]). Writes from code run the cancelable opening / closing events with reason api; a vetoed write is written back. |
title | string | undefined | — | Title text in the header; labels the dialog (aria-labelledby). |
ariaLabel | string | undefined | — | Accessible name when there is no title. |
showOn | OgePopoverShowOn | 'click' | What opens it from a trigger: 'click' (the APG disclosure), 'hover' (dwell + a grace period that survives moving into the panel; keyboard focus opens it too), 'focus' or 'manual' (code only). |
placement | OgePopupPlacement | 'bottom' | Preferred side; flips and clamps against the viewport, RTL-aware. |
arrow | boolean | false | Draws a callout arrow on the edge facing the trigger (geometry shared with the tooltip). |
modal | boolean | false | true: an aria-modal dialog — focus moves in, Tab is trapped, focus returns to the trigger on close. false: a non-modal dialog — focus stays on the trigger, Tab moves into the panel and on past it (as if it followed the trigger inline), and focus leaving closes it. |
showCloseButton | boolean | true | Renders the header ✕ — labelled by messages.popoverClose. |
width | number | string | undefined | — | Content width — px number or CSS length. |
maxWidth | number | string | undefined | — | Maximum content width — px number or CSS length; the stylesheet default is 360px. |
showDelay | number | undefined | — | Hover dwell before opening (hover mode); falls back to popoverShowDelayMs. |
hideDelay | number | undefined | — | Grace period before closing after the pointer left trigger and panel; falls back to popoverHideDelayMs. |
initialFocus | OgePopoverInitialFocus | 'auto' | Focus target on click / API opens: 'auto' (first tabbable when modal, none otherwise), 'none', 'first-tabbable', 'panel' or a CSS selector. Hover / focus opens never move focus; an [autofocus] element always wins. |
restoreFocus | boolean | true | Returns focus to the trigger when a close would lose it (never after an outside click or a focus move). |
closeOnEscape | boolean | true | Escape closes it — through the shared overlay stack, so a select box open inside closes first. |
closeOnOutsideClick | boolean | true | A pointer-down outside trigger and panel closes it. |
closeOnFocusOut | boolean | true | Focus moving outside trigger and panel closes a non-modal popover. Turn it off when the panel hosts editors whose popups take focus elsewhere. |
padding | 'none' | 'sm' | 'md' | 'md' | Body padding preset: 'none' (flush — lists, menus, grids), 'sm' or 'md'. Sets --oge-popover-body-padding on the panel. |
disabled | boolean | false | Prevents opening; closes an open popover. |
anchor | HTMLElement | null | null | Element to anchor to when no trigger opened it (a popover opened from code); falls back to the first [ogePopover] trigger. |
messages | Partial<OgeOverlayMessages> | undefined | — | Per-instance message overrides — popoverClose labels the ✕. |
panelClass | OgeClassValue | undefined | — | Extra classes on the panel element, next to oge-popover. |
panelAttributes | OgeHtmlAttributes | undefined | — | Extra attributes on the panel element. Filtered by ogeSafeAttributes: event handlers (on*), srcdoc, style, class, script URLs and the attributes the component sets itself are dropped (one dev-mode warning per key). |
Methods 4
Template reference (exportAs: 'ogePopover')
| Name | Type | Description |
|---|---|---|
open(): void | void | Opens it (reason api; runs opening). |
close(): void | void | Closes it (reason api; runs closing). |
toggle(target?): void | void | Opens a closed popover, closes an open one. With a target (an event — its currentTarget — or an element) the panel anchors to it; an open popover given a different target moves there instead of closing. |
show(target): void | void | Opens the popover anchored to target (an event — its currentTarget — or an element); already open, it moves there. Focus returns to that element on close — one popover serves many triggers (column headers, row actions). |
Events 4
| Name | Type | Description |
|---|---|---|
opening | OgePopoverOpeningEvent | Cancelable, before every open: { reason, cancel }, reason click | hover | focus | api. |
opened | OgePopoverOpenedEvent | After it opened: { reason }. |
closing | OgePopoverClosingEvent | Cancelable, before every close: { reason, cancel }, reason api | trigger | pointerLeave | focusOut | outside | escape | closeButton. |
closed | OgePopoverClosedEvent | After it closed: { reason }. |
Types 8
| Name | Type | Description |
|---|---|---|
OgePopoverTrigger | directive — selector [ogePopover], exportAs 'ogePopoverTrigger' | The class behind [ogePopover]; import it next to OgePopover. |
OgePopoverShowOn | 'click' | 'hover' | 'focus' | 'manual' | Trigger interaction model. |
OgePopoverOpenReason | 'api' | 'click' | 'hover' | 'focus' | Why it opened. |
OgePopoverCloseReason | 'api' | 'trigger' | 'pointerLeave' | 'focusOut' | 'outside' | 'escape' | 'closeButton' | Why it closed. |
OgePopoverInitialFocus | 'auto' | 'none' | 'first-tabbable' | 'panel' | (string & {}) | Initial-focus strategy (a string is a CSS selector). |
OgePopoverSlotContext | { $implicit: () => void; close: () => void } | Context of *ogePopoverTitle / *ogePopoverFooter. |
OgePopoverOpeningEvent / OgePopoverClosingEvent | { readonly reason; cancel: boolean } | Cancelable pre-events. |
OgePopoverOpenedEvent / OgePopoverClosedEvent | { readonly reason } | Past-tense events. |
OgeActionSheet
oge-action-sheetProperties 11
| Name | Type | Default | Description |
|---|---|---|---|
opened | boolean (model) | false | Two-way open state. A direct false write closes without the closing event (the app already decided); user gestures and close() run it. |
items | readonly OgeActionSheetItem[] | [] | The actions, in order — group: 'bottom' ones render after a divider. Fields: key?, text, description?, icon? (SVG path data, 24×24, stroked), destructive?, disabled?, group?: 'top' | 'bottom'. |
title | string | undefined | — | Heading of the sheet — also its accessible name (aria-labelledby) and the name of the action menu. |
description | string | undefined | — | Secondary text under the title, referenced by aria-describedby. |
ariaLabel | string | undefined | — | Accessible name without a title; falls back to the actionSheetLabel message (“Actions”). |
showCancel | boolean | true | Renders the Cancel button after the menu (a separate Tab stop). |
cancelText | string | undefined | — | Text of the Cancel button; falls back to the actionSheetCancel message. |
closeOnBackdropClick | boolean | true | Closes on a press on the shaded backdrop. |
closeOnEscape | boolean | true | Closes on Escape — only while the sheet is the topmost surface on the shared overlay stack. |
swipeToClose | boolean | true | Closes on a swipe down (≥ 72px) from the handle or the header, on the shared pointer gesture. |
messages | Partial<OgeOverlayMessages> | undefined | — | Per-instance overrides of actionSheetCancel / actionSheetLabel. |
Methods 3
| Name | Type | Description |
|---|---|---|
open() | () => Promise<OgeActionSheetResult> | Opens the sheet (runs the cancelable opening) and resolves with the chosen action, or null when it is dismissed or the open is vetoed. |
close() | () => void | Closes the sheet with reason 'api' (runs closing). |
toggle() | () => void | Opens a closed sheet, closes an open one. |
Events 4
| Name | Type | Description |
|---|---|---|
opening | OgeActionSheetOpeningEvent | Cancelable: the sheet is about to open (open() / toggle()). Set cancel to keep it closed. |
closing | OgeActionSheetClosingEvent | Cancelable: the sheet is about to close — reason ('action', 'cancel', 'escape', 'backdrop', 'swipe', 'api') and the chosen item. |
closed | OgeActionSheetClosedEvent | The sheet closed — reason and the chosen item (or null). Focus is back on the element focused before it opened. |
itemClick | OgeActionSheetItemClickEvent | An action was chosen (click, Enter or Space) — item, index, event. Set keepOpen to keep the sheet open; disabled actions never fire it. |
Types 9
Templates
| Name | Type | Description |
|---|---|---|
OgeActionSheetItemTemplate | [ogeActionSheetItemTemplate] | Structural directive replacing the icon + text of every action. The menuitem button, its keyboard and its disabled / destructive state stay with the sheet, so keep the template non-interactive. Projected content renders between the header and the actions. |
OgeActionSheetItemTemplateContext | { $implicit: OgeActionSheetItem; index: number } | Context of the item template. |
Vocabulary
| Name | Type | Description |
|---|---|---|
OgeActionSheetItem | interface | One action: key?, text, description?, icon? (SVG path data, 24×24, stroked), destructive?, disabled?, group?: 'top' | 'bottom'. |
OgeActionSheetCloseReason | 'action' | 'cancel' | 'escape' | 'backdrop' | 'swipe' | 'api' | Why the sheet closed. |
OgeActionSheetOpeningEvent | { cancel: boolean } | Payload of opening. |
OgeActionSheetClosingEvent | { reason; item: OgeActionSheetItem | null; cancel: boolean } | Payload of closing. |
OgeActionSheetClosedEvent | { reason; item: OgeActionSheetItem | null } | Payload of closed. |
OgeActionSheetItemClickEvent | { item; index: number; event: Event; keepOpen: boolean } | Payload of itemClick. |
OgeActionSheetResult | OgeActionSheetItem | null | What open() resolves with. |
OgeCommandPalette
oge-command-paletteProperties 8
| Name | Type | Default | Description |
|---|---|---|---|
commands | readonly OgeCommand[] (required) | — | The commands, in order. Fields: id, label, group? (the heading it is listed under), keywords? (extra words that find it), description?, shortcut? (shown as a kbd, e.g. Mod+Shift+P), icon? (SVG path data), disabled?, run? (called on run). |
opened | boolean (model) | false | Two-way open state. Opening clears the query and focuses the search box. |
recent | readonly string[] (model) | [] | Ids of the recently run commands, newest first, listed in a "Recent" section above an empty query — two-way, so an app can persist it. |
hotkey | string | null | 'Mod+K' | Global shortcut that toggles the palette — Mod is ⌘ on Apple platforms and Ctrl elsewhere. null turns it off. A keydown another handler already prevented is ignored. |
placeholder | string | undefined | commandPalettePlaceholder message | Placeholder of the search box. |
recentLimit | number | 5 | How many recent commands to keep and list; 0 turns the recent section off. |
maxResults | number | 50 | Upper bound of listed matches for a query (the empty query lists every command). |
messages | Partial<OgeOverlayMessages> | — | Per-instance overrides of commandPaletteLabel, commandPalettePlaceholder, commandPaletteEmpty, commandPaletteRecent and commandPaletteResults. |
Methods 3
| Name | Type | Description |
|---|---|---|
open() | () => void | Opens the palette with an empty query. |
close() | () => void | Closes the palette; focus returns to where it was. |
toggle() | () => void | Opens a closed palette, closes an open one. |
Events 3
| Name | Type | Description |
|---|---|---|
commandExecute | OgeCommandExecuteEvent | A command was chosen — by Enter or a click — after its own run. The palette closes unless the handler sets keepOpen. |
recentChange | readonly string[] | The banana half of [(recent)]: the recent list after a run. |
queryChange | string | The query changed (also when opening or closing clears it). |
Types 12
Matching & keyboard
| Name | Type | Description |
|---|---|---|
Matching | ogeFuzzyMatch | Accent- and case-insensitive fuzzy matching: the query’s characters in order ("gtst" finds "Go to settings"), a prefix first, then a word start (camelCase counts), then a contiguous hit, then a scattered one; keywords score at 80 % and the description at 60 %. Matches keep their groups, each ordered by its best hit, and the matched characters are wrapped in <mark>. |
Keyboard | role="combobox" → role="listbox" | The search box is an APG combobox over a listbox (aria-activedescendant): ↑ / ↓ move and wrap, skipping disabled commands; Page Up / Page Down move by eight; Ctrl+Home / Ctrl+End jump (plain Home / End stay with the text); Enter runs; Escape or a backdrop press closes and focus returns to where it was. A polite status announces the result count. |
Vocabulary
| Name | Type | Description |
|---|---|---|
OgeCommand | interface | One command: id, label, group? (the heading it is listed under), keywords? (extra words that find it), description?, shortcut? (shown as a kbd, e.g. Mod+Shift+P), icon? (SVG path data), disabled?, run? (called on run). |
OgeCommandExecuteEvent | { command: OgeCommand; keepOpen: boolean } | Payload of commandExecute. |
ogeFuzzyMatch | (query, text) => OgeFuzzyMatch | null | The matcher on its own: { score, ranges } with [start, end) ranges in the source text, or null. |
ogeMatchesShortcut | (event, shortcut, apple?) => boolean | Whether a keydown is a shortcut such as Mod+K — for wiring the commands’ own shortcuts. |
ogeFormatShortcut | (shortcut, apple?) => string | A shortcut for display: ⇧⌘P on Apple platforms, Ctrl+Shift+P elsewhere. |
Behavior building blocks (@oge-ui/behavior)
| Name | Type | Description |
|---|---|---|
ogeCommandPaletteSections / ogeCommandPaletteOptions | (commands, query, { recent?, limit? }) => OgeCommandPaletteSection[] | The grouped result list ({ key, group, recent, options }, each option { command, index, score, segments }) and its flat keyboard order. |
ogeCommandPaletteKeyIntent / ogeCommandPaletteFirstActive | (event, active, options, page?) => OgeCommandPaletteKeyIntent | null | The key map ({ kind: 'move' | 'run', index }) and the option made active when the list changes. |
ogeCommandPaletteRecent | (recent, id, limit) => string[] | The recent list after a run: newest first, de-duplicated, bounded. |
ogeFuzzyHighlight / ogeParseShortcut / ogeIsApplePlatform | helpers | Ranges → SearchHighlightSegment[]; Mod+Shift+P → OgeShortcut; whether Mod means ⌘. |
OgeFuzzyMatch / OgeCommandPaletteSection / OgeCommandPaletteOption / OgeCommandPaletteFilterOptions / OgeCommandPaletteKeyIntent / OgeShortcut | types | The shapes of the building blocks above. |
OgeTour
oge-tourProperties 7
| Name | Type | Default | Description |
|---|---|---|---|
steps | readonly OgeTourStep[] (required) | — | The steps, in order. Fields: target? (a CSS selector, an element or a function returning one — missing, hidden or absent centers the card), title (the dialog’s name), content? (its description), placement? (an OgePopupPlacement, default 'bottom', flipped to fit), padding? (spotlight padding in px, default 6). |
opened | boolean (model) | false | Two-way open state. |
step | number (model) | 0 | Two-way index of the shown step, clamped to the steps. |
closeOnEscape | boolean | true | Escape skips the tour. |
closeOnBackdropClick | boolean | false | A press on the dimmed page skips the tour. Off by default: a stray click should not lose the user’s place. |
showSkip | boolean | true | Renders the Skip button (never on the last step). |
messages | Partial<OgeOverlayMessages> | — | Per-instance overrides of tourLabel, tourStep, tourNext, tourPrevious, tourSkip and tourDone. |
Methods 4
| Name | Type | Description |
|---|---|---|
start(step?) | (step?: number) => void | Opens the tour at step (default the first). |
next() | () => void | The next step; on the last one, finishes the tour ('done'). |
previous() | () => void | The previous step (no-op on the first). |
close() | () => void | Closes the tour (reason 'api'). |
Events 2
| Name | Type | Description |
|---|---|---|
stepChange | number | The banana half of [(step)]. |
closed | OgeTourClosedEvent | The tour closed: { reason, step } with 'done' (Done on the last step), 'skip', 'escape', 'backdrop' or 'api' — store it to show a tour once. |
Types 7
Behavior
| Name | Type | Description |
|---|---|---|
Spotlight, card & keys | role="dialog" | Each step dims the page with a spotlight cut around its target, scrolls the target into view (centered; instantly under prefers-reduced-motion, which also stops the spotlight from gliding) and places the card beside it, re-measuring on scroll and resize. The card is a modal role="dialog" (aria-roledescription from tourLabel) with a step counter, Skip, Back and Next — Done on the last step. Focus starts on Next; → / ← move between steps (mirrored in RTL) but never finish the tour; Escape skips; focus returns where it was. A polite status announces “Step 2 of 4: title”. |
Vocabulary
| Name | Type | Description |
|---|---|---|
OgeTourStep | interface | One step: target? (a CSS selector, an element or a function returning one — missing, hidden or absent centers the card), title (the dialog’s name), content? (its description), placement? (an OgePopupPlacement, default 'bottom', flipped to fit), padding? (spotlight padding in px, default 6). |
OgeTourClosedEvent | { reason: OgeTourCloseReason; step: number } | Payload of closed. |
OgeTourCloseReason | 'done' | 'skip' | 'escape' | 'backdrop' | 'api' | Why the tour closed. |
Behavior building blocks (@oge-ui/behavior)
| Name | Type | Description |
|---|---|---|
ogeTourResolveTarget / ogeTourReveal | (target, doc) => Element | null / (element) => void | The rendered element a step points at; scrolling it into view (reduced-motion aware). |
ogeTourSpotlight / ogeTourCardPosition / OgeTourCardPosition | geometry | The padded, viewport-clipped spotlight rect and the card position beside it (via resolvePopupPosition), or centered. |
ogeTourKeyIntent / ogeTourClampStep / ogeTourIsInView | helpers | → / ← to 'next' / 'previous' (RTL-mirrored); the clamped step index; whether a rect is fully visible. |
OgeNotificationCenter
oge-notification-centerProperties 9
| Name | Type | Default | Description |
|---|---|---|---|
items | readonly OgeNotification[] (model) | [] | Two-way: the notifications, newest first whatever the order given. Marking read or dismissing writes a new array. Fields: id, title, body?, time (a Date, an ISO string or epoch ms — shown as a relative time, “5 minutes ago”), read?, group? (the section with grouping="group"), severity? (info, success, warning, danger: the mark’s colour). |
opened | boolean (model) | false | Two-way: the panel is open. |
grouping | 'day' | 'group' | 'none' | 'day' | Sections: Today / Yesterday / Earlier, the items’ group, or one list. |
filter | 'all' | 'unread' (model) | 'all' | Two-way: the panel’s All / Unread switch. |
hasMore | boolean | false | Older notifications exist: scrolling within 80 px of the end, the Load more button or Page Down onto the last article emits loadMore. |
loading | boolean | false | More are loading: the feed is aria-busy and no further loadMore fires. |
width | number | string | 360 | Panel width. |
locale | string | undefined | — | Locale of the relative times (default the browser’s). |
messages | Partial<OgeOverlayMessages> | — | Per-instance overrides of the notifications* messages (see Overlay configuration). |
Methods 1
| Name | Type | Description |
|---|---|---|
markAllRead() | () => void | Marks every notification read. |
Events 4
| Name | Type | Description |
|---|---|---|
itemsChange / openedChange / filterChange | model halves | The banana halves of [(items)], [(opened)] and [(filter)]. |
loadMore | void | Append older notifications to items (and clear hasMore at the end). |
readChange | { item: OgeNotification; read: boolean } | One notification was marked read or unread — tell the server. |
dismissed | OgeNotification | One notification was dismissed (it is already out of items). |
Types 7
Feed and announcements
| Name | Type | Description |
|---|---|---|
Keyboard and screen readers | role="feed" | The list is a WAI-ARIA feed: each notification an article named by its title and described by its body, with aria-posinset / aria-setsize (−1 while hasMore); Page Down / Page Up move between articles, Ctrl+End / Ctrl+Home leave the feed; aria-busy while loading. Unread titles start with a visually hidden “Unread”, the bell says how many are unread, and new unread notifications are announced politely. The panel is the suite’s popover: Escape and an outside click close it and focus returns to the bell. |
Vocabulary
| Name | Type | Description |
|---|---|---|
OgeNotification | interface | One notification: id, title, body?, time (a Date, an ISO string or epoch ms — shown as a relative time, “5 minutes ago”), read?, group? (the section with grouping="group"), severity? (info, success, warning, danger: the mark’s colour). |
OgeNotificationGrouping | 'day' | 'group' | 'none' | How the list is sectioned. |
OgeNotificationFilter | 'all' | 'unread' | Which items the list shows. |
Behavior building blocks (@oge-ui/behavior)
| Name | Type | Description |
|---|---|---|
ogeNotificationSections / OgeNotificationSection / OgeNotificationSectionOptions | (items, { grouping?, filter?, now?, labels? }) => OgeNotificationSection[] | The sections, newest first. |
ogeUnreadCount / ogeMarkNotifications / ogeNotificationTime | helpers | Count unread; mark all or some read / unread (a new array); a notification’s time as epoch ms. |
ogeRelativeTime / ogeShouldLoadMore / ogeFeedKeyIntent | helpers | “5 minutes ago” in the locale (Intl.RelativeTimeFormat); whether a scrolled list is near its end; the feed keys. |
OgeTooltip
[ogeTooltip]Properties 9
| Name | Type | Default | Description |
|---|---|---|---|
ogeTooltip | string | TemplateRef<OgeTooltipTemplateContext> (required) | — | Tooltip text, or a template for rich content (formatting, icons — never focusable controls: a tooltip is not interactive). Applied to any element — the host gets aria-describedby pointing at the panel while it is shown. An empty string disables it. |
tooltipContext | unknown | undefined | Value handed to a template ogeTooltip as $implicit (let-user). |
tooltipShowMode | OgeTooltipShowMode | 'hover' | What shows it: 'hover' (dwell + keyboard focus), 'focus', 'click' (activation toggles; blur and Escape hide it) or 'manual' (only open() / close() / toggle()). |
tooltipArrow | boolean | false | Draws a callout arrow pointing at the trigger (shared geometry with the popover). |
tooltipMaxWidth | number | string | undefined | — | Maximum bubble width — px number or any CSS length; the stylesheet default is 280px. |
tooltipPlacement | OgePopupPlacement | 'top' | Preferred side; flips and clamps against the viewport like every anchored panel. |
tooltipShowDelay | number | undefined | — | Hover dwell before showing, in ms. Falls back to tooltipShowDelayMs from the overlay config. Keyboard focus always shows immediately. |
tooltipHideDelay | number | undefined | — | Grace period after the pointer leaves, in ms; falls back to tooltipHideDelayMs. |
tooltipDisabled | boolean | false | Suppresses the tooltip without removing the directive — hides an already open panel. |
Methods 3
Template reference (exportAs: 'ogeTooltip')
| Name | Type | Description |
|---|---|---|
open(): void | void | Shows the tooltip now, whatever the show mode (no dwell). |
close(): void | void | Hides the tooltip now. |
toggle(): void | void | Shows a hidden tooltip, hides a visible one. |
Types 2
| Name | Type | Description |
|---|---|---|
OgeTooltipShowMode | 'hover' | 'focus' | 'click' | 'manual' | Which trigger interactions show the tooltip. |
OgeTooltipTemplateContext<C> | { $implicit: C } | Context of a template tooltip — tooltipContext. |
OgeAnchoredPanel
Properties 16
Members
| Name | Type | Default | Description |
|---|---|---|---|
panelId | string | — | Unique id applied to the panel element (oge-popup-N) — wire to aria-controls. |
isOpen | Signal<boolean> | — | Open state. |
position | Signal<OgeResolvedPopupPosition | null> | — | null until the first measure after open; hide the panel while null. |
OgeAnchoredPanelOptions (constructor)
| Name | Type | Default | Description |
|---|---|---|---|
anchor | () => HTMLElement | null | — | Anchor element getter (null while not rendered). Required. |
panel | () => HTMLElement | null | — | Panel element getter (null while closed). Required. |
placement | () => OgePopupPlacement | 'bottom-start' | Reactive getter — read signals inside so the next update sees changes. |
width | () => number | 'anchor' | undefined | — | Fixed pixel value or 'anchor' to match the anchor width. |
offset | () => number | undefined | 4 | Main-axis gap between anchor and panel. |
viewportPadding | () => number | undefined | 8 | Minimum distance kept from viewport edges when clamping. |
closeOnOutsidePointerDown | boolean | true | Close on document pointerdown outside anchor+panel (capture phase, composedPath-aware). |
closeOnEscape | boolean | true | Close on Escape — stacked overlays only close the topmost. |
restoreFocus | () => void | — | Restores focus after closes caused by escape/select (only when focus would otherwise be orphaned). |
onClosed | (reason: OgePopupCloseReason) => void | — | Notified after every close with its reason. |
anchorRect | () => OgeRect | null | — | Virtual anchor rectangle used for positioning when it returns a rect — e.g. the pointer location of a context menu. |
transient | boolean | false | Transient surfaces (tooltips) skip the Escape stack so an open tooltip never swallows the Escape meant for the popup underneath. |
arrow | () => boolean | undefined | — | When it returns true, every measure also resolves the callout-arrow geometry into position().arrow (resolvePopupArrow) — the popover and the tooltip render their arrow from it. |
Methods 5
| Name | Type | Description |
|---|---|---|
open(): void | void | Opens (SSR-safe no-op without window); pushes onto the open-panel stack, adds listeners, measures. |
close(reason: OgePopupCloseReason = 'api'): void | void | Closes, removes listeners, restores focus for escape/select, then calls onClosed(reason). |
toggle(): void | void | Open ⇄ close. |
updatePosition(): void | void | Re-measures anchor/panel and recomputes the position (rAF-coalesced). Also runs automatically on scroll/resize/panel growth. |
destroy(): void | void | Removes 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-popupProperties 7
| Name | Type | Default | Description |
|---|---|---|---|
panel | OgeAnchoredPanel (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. |
adaptiveTitle | string | '' | Dialog title while adaptive (editors pass their field label). |
closeLabel | string | '' | Aria label of the adaptive close button, from the owner's messages catalog. |
panelClass | OgeClassValue | undefined | — | Extra classes on the panel element, next to oge-popup. |
panelAttributes | OgeHtmlAttributes | undefined | — | Extra attributes on the panel element. Filtered by ogeSafeAttributes: event handlers (on*), srcdoc, style, class, script URLs and the attributes the component sets itself are dropped (one dev-mode warning per key). |
[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 |
|---|---|---|
<oge-popup> | component | Presentational 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): OgeResolvedPopupPosition | OgeResolvedPopupPosition | Pure 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 17
OgePopupPositionRequest
| Name | Type | Default | Description |
|---|---|---|---|
anchor | OgeRect | — | Anchor rectangle (viewport-relative). Required. |
panel | { width: number; height: number } | — | Measured panel size. Required. |
viewport | { width: number; height: number } | — | Viewport size. Required. |
placement | OgePopupPlacement | — | Preferred placement. Required. |
offset | number | 4 | Gap between anchor and panel on the main axis. |
viewportPadding | number | 8 | Minimum distance kept from viewport edges when clamping. |
rtl | boolean | false | Resolves logical start/end (and left/right sides) against RTL. |
OgeResolvedPopupPosition
| Name | Type | Default | Description |
|---|---|---|---|
top / left | number | — | Viewport-relative — apply with position: fixed. |
placement | OgePopupPlacement | — | 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). |
arrow? | OgePopupArrow | — | Callout-arrow geometry { side, offset }, present when the anchored panel was asked for an arrow — the panel edge facing the anchor and the arrow centre along it, in px. |
Callout arrow
| Name | Type | Default | Description |
|---|---|---|---|
resolvePopupArrow(req: OgePopupArrowRequest): OgePopupArrow | OgePopupArrow | — | Pure arrow geometry shared by the popover and the tooltip in both layers: the arrow sits on the panel edge facing the anchor (RTL-aware) and points at the anchor centre, clamped edgePadding (default 12px) inside the edge so it never rides over a rounded corner after the viewport clamp shifted the panel. |
OGE_POPUP_ARROW_SIZE | number | 7 | How far the arrow tip reaches out of the edge; hosts add it to the panel offset while an arrow is shown. |
Supporting types
| Name | Type | Default | Description |
|---|---|---|---|
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): Provider | Provider | Application- or component-scoped defaults. |
Types 11
OgeOverlayConfig
| Name | Type | Default | Description |
|---|---|---|---|
offset | number | 4 | Gap between anchor and panel on the main axis. |
viewportPadding | number | 8 | Minimum distance kept from viewport edges when clamping. |
typeAheadMs | number | 500 | Idle time after which the menu type-ahead buffer resets. |
menuShowDelayMs | number | 50 | Hover dwell time before a submenu parent row opens its submenu. |
menuHideDelayMs | number | 300 | Grace period before an open submenu closes after hovering a sibling row — the diagonal-pointer allowance. |
tooltipShowDelayMs / tooltipHideDelayMs | number | 400 / 100 | Hover dwell before a tooltip shows (focus shows immediately) and the grace period before it hides. |
popoverShowDelayMs / popoverHideDelayMs | number | 150 / 300 | Hover dwell before a showOn: 'hover' popover opens, and the grace period after the pointer left trigger and panel — long enough to travel across the gap into the panel. |
toastPosition / toastDisplayTime / toastMaxVisible / toastProgressBar / toastCoalesceDuplicates | OgeToastPosition / number / number / boolean / boolean | 'bottom-end' / 4000 / 5 / false / false | Toast defaults. |
toastStacked | boolean | false | Toast stack mode: each region collapses into a deck — the newest toast in front, two more peeking behind it — that expands into a list while the pointer or focus is in it (pausing every timer in it); toasts swipe away sideways (reason 'swipe'). The moves glide on transforms; reduced motion switches at once. |
messages | OgeOverlayMessages | — | User-facing strings of the modal header buttons, the toast chrome, the popover, the action sheet and the command palette: modalClose, modalMaximize, modalRestore, toastClose, toastRegionLabel, toastCountBadge, popoverClose, the action sheet’s actionSheetCancel / actionSheetLabel and the palette’s commandPaletteLabel, commandPalettePlaceholder, commandPaletteEmpty, commandPaletteRecent and commandPaletteResults (an ICU plural over {count}), and the tour’s tourLabel, tourStep (Step {index} of {count}), tourNext, tourPrevious, tourSkip and tourDone, and the notification center’s notificationsLabel, notificationsBell (an ICU plural over the unread {count}), notificationsAll, notificationsUnread, notificationsMarkAllRead, notificationsMarkRead, notificationsMarkUnread, notificationsDismiss, notificationsToday, notificationsYesterday, notificationsEarlier, notificationsEmpty, notificationsLoading, notificationsLoadMore and notificationsNew (optional; English “Close”, “Cancel” and “Actions” when a catalog predates them). |
messages — dialog helpers & window | OgeOverlayMessages (optional keys) | — | dialogOk ('OK'), dialogCancel ('Cancel'), dialogConfirmTitle ('Confirm'), dialogAlertTitle ('Notice'), dialogPromptTitle ('Enter a value'), dialogRequired ('This field is required.'), windowMinimize ('Minimize'), windowMoved ('Window moved to {x}, {y}'), windowResized ('Window resized to {width} by {height}'). Optional so existing catalogs keep type-checking; English fills the gaps. |
Overlay primitives
Methods 9
Escape stack
| Name | Type | Description |
|---|---|---|
pushOverlay(surface: object): void | void | Registers a surface as the new topmost overlay. No-op if it is already in the stack. |
removeOverlay(surface: object): void | void | Removes a surface from the stack; tolerates surfaces that were never pushed. |
isTopOverlay(surface: object): boolean | boolean | True only for the topmost surface. For Escape handling use claimOverlayEscape instead: it also makes sure one key press closes one layer. |
claimOverlayEscape(event: Event, surface: object): boolean | boolean | Claims an Escape key event for surface: true only when it is the topmost overlay and no surface acted on this event yet. Gate your own overlay’s Escape handler on it (after pushOverlay): every listener on document runs regardless of stopPropagation(), so with isTopOverlay alone the layer below the one that just closed would close in the same key press. Every OGE modal, drawer, popup, popover, menu and action sheet uses it, so app layers and OGE layers close one per Escape, top first. |
isOverlayEscapeClaimed(event: Event): boolean | boolean | Whether a surface already acted on this Escape event — for handlers outside the stack (a page-level shortcut) that must ignore an Escape an overlay consumed. |
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): void | void | Wraps 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(): void | void | Locks body scroll and compensates for the scrollbar width. Ref-counted, so nested surfaces cannot unlock each other. |
unlockBodyScroll(): void | void | Releases one reference; the last release restores the inline styles exactly as they were. |
OgeModalHarness
Properties 1
Harness
| Name | Type | Description |
|---|---|---|
hostSelector | 'oge-modal' | Static. The host selector the CDK loader matches — import from @oge-ui/overlay/testing; @angular/cdk is an optional peer only this entry needs. |
Methods 12
Finding the modal
| Name | Type | Description |
|---|---|---|
with(filters?: OgeModalHarnessFilters) | HarnessPredicate<OgeModalHarness> | Static. Predicate for loader.getHarness(): selector, ancestor, title (string or RegExp) and open. Service-opened modals live in document.body: use TestbedHarnessEnvironment.documentRootLoader(fixture). |
State
| Name | Type | Description |
|---|---|---|
isOpen() | Promise<boolean> | Whether the modal is open (its panel is rendered). |
getTitle() | Promise<string> | The title — the heading’s text, or the aria-label of an untitled modal. |
getRole() | Promise<string | null> | The panel's role: 'dialog' or 'alertdialog'. |
isBusy() | Promise<boolean> | Whether the modal reports aria-busy. |
getContentText() | Promise<string> | Text of the modal body (the projected content). |
Actions
| Name | Type | Description |
|---|---|---|
getButtonTexts() | Promise<string[]> | Labels of the action buttons — the footer’s, or an alert / confirm / prompt dialog’s; text, or aria-label when empty. |
clickButton(label: string | RegExp) | Promise<void> | Clicks the matching action button; throws with the button list when none matches. |
close() | Promise<void> | Clicks the header’s close (✕) button — the full close pipeline runs. |
pressEscape() | Promise<void> | Presses Escape inside the modal (closeOnEscape). |
clickBackdrop() | Promise<void> | Presses on the backdrop outside the panel (closeOnBackdropClick). |
Content container
| Name | Type | Description |
|---|---|---|
getHarness / getHarnessOrNull / getAllHarnesses / getChildLoader | ContentContainerComponentHarness | Search the open panel for other harnesses — the editors of a modal form are one call away. |
Types 1
| Name | Type | Description |
|---|---|---|
OgeModalHarnessFilters | BaseHarnessFilters & { title?: string | RegExp; open?: boolean } | Options of OgeModalHarness.with(). |
Notes
- The overlay config's
messagesblock 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
ResizeObserveron the panel handles async content growth.