Overlays and modals

Alert Dialog
v0.3.1
Ready for Production

A modal dialog requiring explicit user acknowledgment before proceeding with a critical or destructive action.

Prefer AI-assisted development?

This documentation is available via the Catalyst MCP Server. Learn how to connect →

An Alert Dialog interrupts the user to confirm a critical action, typically one that is potentially destructive or cannot be undone. It requires the user to explicitly acknowledge the message before continuing. Alert Dialogs are modal and use clear, focused language to communicate risk and intent. Catalyst Alert Dialog extends Radix UI Alert Dialog with built-in design tokens and accessibility defaults, plus Tailwind-based styling.

Preview

Installation

npm install @pmi/catalyst-alert-dialog
import {
  AlertDialogRoot,
  AlertDialogPortal,
  AlertDialogOverlay,
  AlertDialogContent,
  AlertDialogTrigger,
  AlertDialogTitle,
  AlertDialogDescription,
  AlertDialogAction,
  AlertDialogCancel,
} from '@pmi/catalyst-alert-dialog';

Add the AlertDialog Tailwind preset to your tailwind.config.ts:

import tailwindAlertDialogPreset from "@pmi/catalyst-alert-dialog";

export default {
  presets: [tailwindAlertDialogPreset],
  // ...
};

API Reference

Alert Dialog is a compound component built on Radix UI primitives. The sections below summarize the shared API surface for each part of the component.

AlertDialogRoot

Controls the dialog state and composition.

Accepts all standard Radix Alert Dialog Root props.

AlertDialogTrigger

The trigger that opens the dialog.

Accepts all standard Radix Alert Dialog Trigger props and forwards refs to the underlying trigger element.

AlertDialogPortal

Renders the dialog content in a portal.

Accepts all standard Radix Alert Dialog Portal props.

AlertDialogOverlay

The backdrop shown behind the dialog.

Accepts all standard Radix Alert Dialog Overlay props and forwards refs to the overlay element.

AlertDialogContent

The main dialog container.

Accepts all standard Radix Alert Dialog Content props and forwards refs to the content element.

AlertDialogTitle

The title text rendered in the dialog heading.

Accepts all standard Radix Alert Dialog Title props and forwards refs to the title element.

AlertDialogDescription

The descriptive text shown below the dialog title.

Accepts all standard Radix Alert Dialog Description props and forwards refs to the description element.

AlertDialogAction

The primary action button inside the dialog.

Accepts all standard Radix Alert Dialog Action props and forwards refs to the underlying action element.

AlertDialogCancel

The secondary action that closes the dialog.

Accepts all standard Radix Alert Dialog Cancel props and forwards refs to the underlying cancel element.

Accessibility

Keyboard Interactions

KeyAction
TabMoves focus through interactive elements within the dialog while it is open
Shift + TabMoves focus backward through the dialog's focus order
EscapeCloses the dialog

ARIA

  • Uses the Radix alertdialog pattern, including dialog labeling and description wiring.
  • The title is announced as the dialog label and the description is announced as supporting context.
  • Provide an aria-label when using icon-only actions or triggers with no visible text label.
  • Catalyst does not change the inherited Radix accessibility model; it keeps the same focus management, labelling, and dismissal behavior.

See the Radix UI Alert Dialog accessibility docs for inherited behavior.

Choosing the Right Component

Use Radix UI Alert Dialog when you need to interrupt the user with a critical message that requires an explicit decision before continuing. Reach for a different primitive when:

If you need…Use instead
a general modal for forms, settings, or custom contentDialog
a side panel that can hold longer content or multi-step actionsSheet
lightweight contextual content anchored to a triggerPopover
a passive notification that does not require a responseToast

On this page