Alert Dialog
A modal confirmation surface for actions that require an explicit decision.
A modal confirmation surface for actions that require an explicit decision.
Backed by Base UI Alert Dialog for upstream behavior and configuration. Zenos owns the public API, styling, and composition shown on this page.
Import
Section titled “Import”import { AlertDialog } from "@zentara-co/zenos-ui";Confirmation patterns
Section titled “Confirmation patterns”Match the action tone to the consequence. Reversible actions can use the primary action, while destructive and irreversible actions should use the destructive treatment and explicit wording.
Controlled state
Section titled “Controlled state”Control visibility when the surrounding flow needs to observe or coordinate the decision. Action and Cancel both close the modal after their handlers run.
No decision
Nested backdrops
Section titled “Nested backdrops”AlertDialog.Content includes a backdrop through AlertDialog.Overlay. The overlay defaults to forceRender={true} so it can render inside another dialog, including a closed sheet. This does not open the alert dialog or keep it mounted when closed. When composing the overlay yourself, pass forceRender={false} to use Base UI’s default nested-backdrop behavior.
AlertDialog.Root AlertDialog.Trigger AlertDialog.Content AlertDialog.Header AlertDialog.Title AlertDialog.Description AlertDialog.Footer AlertDialog.Cancel AlertDialog.Action
API
| Prop | Type | Default | Description |
|---|---|---|---|
open | boolean | — | Controlled open state. |
defaultOpen | boolean | false | Initial uncontrolled open state. |
onOpenChange | (open: boolean, eventDetails) => void | — | Runs when open state changes. |
render | ReactElement | function | — | Composes triggers and actions with another element. |
variant / size | ButtonVariant / sm | md | lg | — | Styles Trigger, Action, and Cancel controls. |
forceRender (Overlay) | boolean | true | Allows the backdrop to render inside another dialog, including a closed sheet. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props,
including className, style, aria-*, and data-*.
Accessibility
Section titled “Accessibility”AlertDialog uses role="alertdialog", traps focus, prevents casual outside dismissal, and returns focus to its trigger. Always provide a title and a description of the consequence. Use specific action text such as “Delete permanently” instead of a vague “Continue,” and make the safe cancellation path easy to identify.