Binhlaig logoBinhlaig UI
Components/Alert Dialog
Binhlaig UI Component

Alert Dialog

Alert Dialog interrupts the user with an important confirmation before a destructive or irreversible action.

Installation

Install Alert Dialog in your project.

Terminal
npx binhlaig-ui@latest add alert-dialog

For project setup, installer selection, dependencies, and advanced installation instructions, see the Installation Guide.

View Installation Guide →Update or Overwrite →

Import

Import the Alert Dialog primitives from your UI components directory.

Terminal
import {
  AlertDialog,
  AlertDialogAction,
  AlertDialogCancel,
  AlertDialogContent,
  AlertDialogDescription,
  AlertDialogFooter,
  AlertDialogHeader,
  AlertDialogTitle,
  AlertDialogTrigger,
} from "@/components/ui/alert-dialog";

Usage

Use Alert Dialog for actions that require explicit confirmation.

Destructive Action

Use a danger action when deleting data or an account.

Sign Out Confirmation

Confirm before ending the current user session.

Warning Dialog

Use warning styling for risky but reversible actions.

Controlled State

Control the dialog state from your own React state.

API Reference

Components available in the Binhlaig UI Alert Dialog.

ComponentPurposeDescription
AlertDialogRootControls open state and coordinates all dialog parts.
AlertDialogTriggerTriggerOpens the alert dialog.
AlertDialogContentContentRenders the modal overlay and dialog panel.
AlertDialogHeaderLayoutGroups the title and description.
AlertDialogTitleHeadingProvides the accessible dialog title.
AlertDialogDescriptionDescriptionExplains the action and its consequences.
AlertDialogFooterLayoutGroups confirmation and cancellation actions.
AlertDialogCancelCancelCloses the dialog without confirming.
AlertDialogActionConfirmConfirms the requested action.