v0.3.1 StableFoundation ComponentReact 18 & 19Zero Runtime CSS
AlertDialog
Confirm a consequential action in a native modal.
Interactive preview
Usage
import { AlertDialog } from "@devvy-ui/react";
<AlertDialog title="Archive project?" open={open} onOpenChange={setOpen} confirmLabel="Archive" onConfirm={archive} />API reference
Native HTML attributes, className, style and a forwarded ref are supported. Component-specific props:
| Prop | Type | Default | Description |
|---|---|---|---|
| confirmLabel | string | required | Explicit action name. |
| onConfirm | () => void | required | Application action. |
| pending | boolean | false | Disables confirmation/cancel actions. |
| Dialog props | DialogProps | required | Title, visibility and focus behavior. |
Accessibility & behavior
Platform Behavior & Guidelines
Uses existing Dialog focus and fallback behavior, with an alertdialog role, explicit cancel and confirmation actions. The application owns pending state and closes on successful completion.
Source ownership
Run npx @devvy-ui/cli init once in your React project, then add the source:
npx @devvy-ui/cli add alert-dialogMake the source yours.
Start from the canonical implementation used by the package and registry. Change the code, keep the MIT notice, and build the behavior your project needs.
AlertDialog.tsxREACT / TSX
Edit your own copy. Downloaded source uses your changes; the component preview above uses the shipped version. Run the source installer first to include shared helpers.