Ballmac UI home

Alert Dialog

Focus-managed confirmation for consequential actions, with a clear cancel path, optional media, and a token-based destructive action.

Launch workspace

12 files · updated today

Installation

$ pnpm dlx shadcn@latest add @ballmac/alert-dialog

Usage

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

The full example is in the Code tab above.

Examples

Confirmation styles

API reference

<AlertDialogContent>

PropTypeDefault
size

Width of the confirmation panel.

"default" | "sm""default"

<AlertDialogAction>

PropTypeDefault
destructive

Highlight a destructive commitment with the semantic destructive token.

booleanfalse

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
Tab / Shift+TabMoves within the modal choices
Enter / SpaceActivates the focused choice
EscapeCancels when the dialog permits dismissal

Use with AI

Ask for explicit confirmation before a consequential action; cancel remains the safe keyboard path. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Alert Dialog (@ballmac/alert-dialog) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Delete or revoke something permanent
  • Confirm an action with a material consequence

Not for

  • Show information without requiring a choice; use dialog
  • Confirm a low-risk routine action

Registry JSON: https://ui.ballmac.com/r/alert-dialog.json

Credits

Free to use in personal and commercial projects.

Registry
shadcn/utils