OGE logoOGE

Alert API

Full surface of oge-alert, its [ogeAlertActions] / [ogeAlertIcon] slots and the config provider.

Properties Methods Events Types

OgeAlert

oge-alert

Properties 8

Name Type DefaultDescription
severity'info' | 'success' | 'warning' | 'error' | undefinedconfig ?? 'info'Meaning of the message — the colour, the glyph, the visually hidden prefix and (with live: auto) the role: error / warning are role="alert", info / success role="status".
titlestring | undefined—Bold first line above the message; the severity prefix moves into it.
stylingMode'soft' | 'outlined' | 'filled' | undefinedconfig ?? 'soft'soft is a tinted surface with a severity rail, outlined a coloured frame, filled the solid severity colour with --oge-severity-contrast text.
dismissiblebooleanfalseRenders a real dismiss button (name from the dismiss message) that runs the cancelable close. When the alert held focus, focus moves to the next tabbable element (ogeAlertFocusAfterClose).
live'auto' | 'polite' | 'assertive' | 'off''auto'auto derives alert / status from the severity, assertive / polite force one, off renders no role (a permanent note). The role stays while the alert is hidden, so showing it again is announced (ogeAlertRole).
showIconbooleantrueShows the severity glyph (or the projected [ogeAlertIcon]); false drops the icon column.
ariaLabelstring | undefined—Accessible name of the live region — only written while the alert has a role.
visibleboolean (model)trueWhether the alert is shown — two-way. false renders nothing and sets hidden on the host.

Methods 2

Name Type Description
show()() => voidShows the alert again.
close()() => voidRuns the cancelable close (closing → closed), as the dismiss button does.

Events 3

Name Type Description
visibleChangebooleanThe banana half of [(visible)].
closingOgeAlertClosingEventCancelable: the alert is about to close. Set cancel to keep it.
closedOgeAlertClosedEventThe alert closed (visible is now false).

Types 7

Name Type Description
OgeAlertActionsdirective [ogeAlertActions]Marks a row of real controls rendered under the message (in the Tab order).
OgeAlertIcondirective [ogeAlertIcon]Replaces the default glyph; rendered inside an aria-hidden wrapper.
OgeAlertSeverity'info' | 'success' | 'warning' | 'error'Severity vocabulary.
OgeAlertStylingMode'soft' | 'outlined' | 'filled'Surface presets.
OgeAlertLive'auto' | 'polite' | 'assertive' | 'off'Live-region behaviour.
OgeAlertClosingEvent{ event?: Event; cancel: boolean }Payload of closing.
OgeAlertClosedEvent{ event?: Event }Payload of closed.

Configuration

Properties 2

provideOgeAlertConfig()

Name Type Description
messagesOgeAlertMessagesEvery user-facing string: dismiss (default Dismiss) and the visually hidden severity prefixes info / success / warning / error (default Information, Success, Warning, Error). Translated in every @oge-ui/locales pack (layout.alert).
severity / stylingMode—Defaults for the matching inputs. Pass a function for a live config.

Types 7

Name Type Description
provideOgeAlertConfig(config: OgeAlertConfigInput | (() => OgeAlertConfigInput)) => ProviderApplication- or component-scoped defaults; a function makes the config live.
OGE_ALERT_CONFIGInjectionToken<OgeAlertConfig>The resolved config the alert injects.
OGE_DEFAULT_ALERT_CONFIGOgeAlertConfigThe defaults (from @oge-ui/behavior).
OGE_DEFAULT_ALERT_MESSAGESOgeAlertMessagesThe English catalog.
OgeAlertConfig{ messages: OgeAlertMessages; severity?; stylingMode? }Resolved config shape.
OgeAlertConfigInputPartial<OgeAlertConfig> with partial messagesWhat the provider accepts.
OgeAlertMessages{ dismiss; info; success; warning; error }The alert catalog.