Alert Dialog

A modal dialog that interrupts the user with important content and expects a response. Uses role=alertdialog and cannot be dismissed by Escape or clicking outside.

Basic

A simple confirmation dialog with Cancel and Continue actions.

Destructive

A destructive confirmation dialog with a styled delete action.

Usage

julia
using Suite

AlertDialog(
    AlertDialogTrigger(
        Button(variant="outline", "Show Alert Dialog")
    ),
    AlertDialogContent(
        AlertDialogHeader(
            AlertDialogTitle("Are you sure?"),
            AlertDialogDescription("This action cannot be undone."),
        ),
        AlertDialogFooter(
            AlertDialogCancel("Cancel"),
            AlertDialogAction("Continue"),
        ),
    ),
)

Keyboard Interactions

KeyAction
TabMove focus between Cancel and Action buttons
Enter / SpaceActivate the focused button

API Reference

AlertDialog

PropTypeDefaultDescription
children...Any-AlertDialog sub-components
classString""Additional CSS classes

AlertDialogTrigger

PropTypeDefaultDescription
children...Any-Element that opens the dialog
classString""Additional CSS classes

AlertDialogContent

PropTypeDefaultDescription
children...Any-Dialog content (header, footer, etc.)
classString""Additional CSS classes

AlertDialogHeader

PropTypeDefaultDescription
children...Any-Header content (title, description)
classString""Additional CSS classes

AlertDialogFooter

PropTypeDefaultDescription
children...Any-Footer content (action buttons)
classString""Additional CSS classes

AlertDialogTitle

PropTypeDefaultDescription
children...Any-Dialog title text
classString""Additional CSS classes

AlertDialogDescription

PropTypeDefaultDescription
children...Any-Dialog description text
classString""Additional CSS classes

AlertDialogAction

PropTypeDefaultDescription
children...Any-Action button text (e.g. "Continue", "Delete")
classString""Additional CSS classes

AlertDialogCancel

PropTypeDefaultDescription
children...Any-Cancel button text (e.g. "Cancel")
classString""Additional CSS classes