Usage
behavior is RequiredActionDialogBehavior.Dismissible unless you set it.
Dismissible (the default). The dialog has a header close control (name it with the required closeLabel) and Escape closes it, as every dialog does. A backdrop press never does. Closing it does not complete the action: the block reports the close to the host through onOpenChange(false, details), with the reason close-press for the control and close-request for Escape. open stays the host's. The action is still required, so the host, or the router that raised the dialog, decides when it comes back, like an update the person postponed. The block has no timer and no snooze.Forced (the rare exception). No close control, no Escape, no backdrop dismissal, and only the host closes it. Use it only for a condition the person cannot safely continue past, such as a forced logout, in a flow that owns that decision. Routed notification dialogs are Dismissible. Forced rejects closeLabel and onOpenChange in its types.Dismissible is the right choice unless there is no safe way to continue. Never use Forced to make an ordinary notification harder to ignore. The host owns closing a forced dialog, so it must always give the person a way to complete the required action.
Banner with BannerType.Critical.toast, with ToastSeverity.Error only for a failure that needs action.ConfirmDialog.open is required and the host owns it in both behaviors. There is no defaultOpen and no trigger. A close request is reported, never applied: the host sets open to false when the condition is resolved or the dialog is set aside, and focus returns to where it was before the dialog opened.
primaryAction is required in both behaviors. It takes initial focus and sits last, at the inline end. secondaryActions are optional and sit before it, in order. Each action is { label, onPress, intent? }.
RequiredActionIntent.Destructive is for an action that is itself irreversible (discarding unsaved work to sign out). A severe condition is not a reason: a forced logout that only ends the session is the default intent.onPress:
open to false.errorCode (a DisplayValue) with errorCodeLabels to show a code the person can read to support, with a copy button. The labels are required with the code and rejected without it.
body is inert behind a modal dialog and cannot be clicked. The block has no slot, so there is nothing to put one in.@prepared911/ui/styles.css once at the document root.