ui

Alert Dialog

A dialog that requires user response to proceed. Built with Base UI and Tailwind CSS. Copy-paste ready.

API Reference

Installation

Usage

AlertDialogFooter Variant

The AlertDialogFooter component supports a variant prop to control its styling:

  • default (default): Includes a border-top, background color, and padding
  • bare: Removes the border and background for a minimal appearance

Examples

Small Size

A compact alert dialog with a smaller popup size, suitable for brief single-action confirmations.

Nested In Dialog

Nests an alert dialog trigger inside an open dialog to demonstrate stacked overlay behavior with correct focus management.

Task Success Confirmation

A success-state dialog confirming a completed action with a checkmark icon and a single dismiss button.

Account Deactivation

A destructive confirmation dialog for deactivating an account, requiring the user to type the account name before proceeding.

Unsaved Changes

Warns the user that navigating away will discard unsaved changes, with options to cancel or confirm the discard.

Ticket Registration

A success dialog confirming ticket registration details with event information and a dismiss or download action.

System Update Notification

Notifies the user of a pending system update with options to install now or postpone to a later time.

Expired Subscription

An alert informing the user that their subscription has expired, with a direct link to the billing renewal page.

Logout Confirmation

Asks the user to confirm their intent to log out before the session is ended.

File Overwrite Confirmation

A three-button dialog that appears when uploading a file that already exists — letting the user choose to keep both copies, skip the upload, or replace the existing file.

Subscription Downgrade Warning

Displays a bulleted list of Pro features the user will lose if they confirm the downgrade, making the consequence of the action explicit before they proceed.

Transfer Ownership

A typed-confirmation dialog that requires the user to enter the word "transfer" before the destructive button becomes enabled, preventing accidental ownership changes.

Clear All Data

A checkbox consent gate that must be checked before the Delete button activates. The checkbox and button state both reset when the dialog is dismissed without confirming.

Rate Limit Exceeded

Shows a live countdown timer indicating when the user may retry. Uses a nested Countdown component driven by useEffect to decrement the displayed time each second.