Class Alert
- All Implemented Interfaces:
Component
Severity controls styling only; this component does not assign a role or live-region announcement policy. Application-supplied attributes are retained.
Mutable and not thread-safe while being configured. Finish configuration before sharing a stable structure or compiling a template; use slots/context for per-request values.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class HtmlTag
attributes, children, id, innerText, innerTextSlot, selfClosing, tagName, trustedHtml -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AlertConfigures one native, non-submit close button namedDismiss alert.static Alertstatic Alertstatic AlertAlias forHtmlTag.addClass(String).Methods inherited from class HtmlTag
addClass, addStyle, addTrustedStyle, getChildrenStream, getId, hxDelete, hxGet, hxInclude, hxPatch, hxPost, hxPushUrl, hxPut, hxScrollTargetTop, hxSwap, hxTarget, hxTrigger, render, withAttribute, withChild, withId, withInnerText, withInnerText, withMaxWidth, withMinWidth, withUnsafeHtml, withWidth
-
Constructor Details
-
Alert
-
-
Method Details
-
info
-
success
-
warning
-
danger
-
dismissible
Configures one native, non-submit close button namedDismiss alert. Repeated calls retain the dismissible class without adding another control.Load
/css/framework.cssand/js/framework.jsonce in the page shell. Native activation hides the nearest usable dismissible alert withhidden; the DOM is retained and dismissal is not persisted. Cancelled, disabled, unavailable or covered-modal controls do not dismiss an alert. Later inserted alerts need no reinitialization.If the alert held focus, an application-selected replacement is respected. In the top Modal, focus stays within that dialog. On ordinary pages, surviving containing elements are tried with native focus first; only an absent
tabindexmay be borrowed as-1while focus needs it. Caller attributes, including malformed values and later same-value writes, are not overwritten or removed. Borrowed state is released on blur, failed focus or disconnection and can be restored when that containing element was a modal opener.Custom themes/layouts, application focus flows and role/live-region semantics remain application responsibilities.
- Returns:
- this alert
-
withClass
-