OGE logoOGE

Toast

OgeToastService shows stacked, auto-dismissing notifications in body-appended regions above every other surface — including open modals. Toasts never steal focus and never join the Escape stack; screen readers hear them through the document’s shared live regions (errors assert, the rest stay polite). Timers pause on hover, focus and while the tab is hidden, always resuming with the remaining time.

OgeToastService promise() coalesce action

Severities

One sugar method per severity — the accent bar, icon and screen-reader mode follow. title adds a bold first line; announce overrides the politeness (errors assert by default).

success/info/warning/error title announce

Positions & stacking

Six logical positions (top/bottom × start/center/end) — RTL flips start/end automatically. The newest toast lands nearest the screen edge; extras beyond toastMaxVisible wait in a lossless FIFO queue and promote as slots free up. Try the burst button.

position toastMaxVisible FIFO queue

Sticky, action & undo

sticky disables auto-dismiss — recommended whenever there's an action, so keyboard users can reach it. The action press closes with reason 'action'; awaiting ref.closed gives a clean undo pattern without extra state.

sticky action ref.closed
—

Promise toasts

promise() shows a sticky spinner toast and morphs it in place when the promise settles — success or error accepts a message or a function returning a message or a full patch. The auto-dismiss timer only starts on settle. Under the hood it's the public ref.update() — usable for any live-updating toast.

promise() in-place morph ref.update

Coalescing & progress

With coalesce an identical toast doesn't pile up — the existing one gains a live ×N badge, restarts its timer and re-announces. progressBar shows the remaining time as a compositor-only bar that freezes exactly in sync with the paused timer.

coalesce ×N badge progressBar

Live announcements without a toast

Toasts, the grid, the tree list, the Gantt and the uploader all speak through OgeLiveAnnouncer — one polite and one assertive visually hidden region per document, created on first use. Inject it for your own status messages: identical messages within a second are dropped, a newer one inside the write delay wins, and the region clears after a few seconds so a repeat is heard again. A no-op on the server.

OgeLiveAnnouncer polite / assertive debounced

Notes

  • Defaults live in provideOgeOverlayConfig({ toastPosition, toastDisplayTime, toastMaxVisible, toastProgressBar, toastCoalesceDuplicates }); the ✕ label, region label and count badge localize via the messages block.
  • Toast regions sit at the end of <body>, so their buttons are the last Tab stops; focusing a toast pauses its timer (WCAG 2.2.1).
  • template replaces the body for fully custom content — heavy interactive flows belong in OgeModalService instead.