Alert Dialog

A modal dialog that interrupts the user with important content and expects a response.

Are you absolutely sure?

This action cannot be undone. This will permanently delete your item and remove it from our servers.

Installation

CLI

Install the component using the StarUI CLI:

star add alert-dialog

Examples

Basic Alert Dialog

Simple alert dialog with dismiss and confirm actions

Heads up!

This is an important message that requires your attention.

Destructive Action

Delete confirmation with detailed information

Danger Zone

Irreversible actions

Delete Repository

Once deleted, it will be gone forever

Delete Repository

This action cannot be undone. This will permanently delete the repository and all of its contents.

The following will be deleted:

  • All source code and version history
  • Issues, pull requests, and comments
  • Wiki pages and project settings
  • All collaborator associations

Unsaved Changes

Prompt user about unsaved changes before exiting

Document Editor

Edit your document details

Make changes to the document fields above and try to save.

Save changes?

You have unsaved changes. What would you like to do?

Your changes:

Title: My Document

Author: John Doe

Session Timeout

Auto-triggered alert with countdown timer

Session Management

Auto-logout demonstration with warning

Session Expiring Soon

Your session will expire in 15 seconds. Do you want to continue?

Batch Operations

Confirm actions on multiple selected items

Batch Operations

Confirm actions on multiple items

items selected

Delete Multiple Items

You are about to delete items. This action cannot be undone.

The following items will be deleted:

  • file1.txt
  • file2.pdf
  • file3.jpg
  • file4.doc

Payment Confirmation

Secure payment confirmation with order details

Complete Purchase

Review your order

Product:

Premium Plan

Price:

$99.00

Tax:

$9.90

Total:

$108.90

Confirm Payment

Please review and confirm your purchase

Secure Payment

Your payment information is encrypted and secure

Amount to charge: $108.90

Card ending in: ****4242

API Reference

Component Description
AlertDialog Container for alert dialog functionality
AlertDialogTrigger Button or element that opens the dialog
AlertDialogContent Main dialog content container
AlertDialogHeader Header section with title and description
AlertDialogTitle Dialog title text
AlertDialogDescription Dialog description or message
AlertDialogFooter Footer with action buttons
AlertDialogAction Primary action button (e.g., Confirm, Delete)
AlertDialogCancel Cancel/dismiss button