Alert Dialog

Overlays
Local guide ↗ import { AlertDialog } from "bits-ui"

Destructive confirmation

Cancel exits without committing; Action confirms the irreversible operation

No action taken

Controlled state

An external control opens the alert while Cancel and Action retain distinct semantics

Analytics workspace

Current access: Editor

AlertDialog.Portal renders into document.body by default, so a high z-index on the portalled overlay/content clears page-level stacking contexts. Alert dialogs trap focus and lock body scrolling; unlike a regular dialog, initial focus lands on the content so a screen reader announces the warning. Focus returns to the trigger when the alert closes.

Escape closes by default, but outside interaction is ignored by default to prevent accidental confirmation dismissal. Those policies are configurable through escapeKeydownBehavior and interactOutsideBehavior on AlertDialog.Content. Use Cancel for the no-op path and Action only for the committing path; both close the alert.