WFP logoDesign System

Alert Dialog

View on shadcn/ui

A modal dialog that interrupts the user with important content and expects a response.

Installation

pnpm dlx shadcn@latest add https://designsystem.wfp.org/r/alert-dialog.json

Usage

import {
  AlertDialog,
  AlertDialogAction,
  AlertDialogCancel,
  AlertDialogContent,
  AlertDialogDescription,
  AlertDialogFooter,
  AlertDialogHeader,
  AlertDialogTitle,
  AlertDialogTrigger,
} from "@/components/ui/alert-dialog";
<AlertDialog>
  <AlertDialogTrigger>Open</AlertDialogTrigger>
  <AlertDialogContent>
    <AlertDialogHeader>
      <AlertDialogTitle>Confirm action</AlertDialogTitle>
      <AlertDialogDescription>
        Please confirm you want to proceed with this action.
      </AlertDialogDescription>
    </AlertDialogHeader>
    <AlertDialogFooter>
      <AlertDialogCancel>Cancel</AlertDialogCancel>
      <AlertDialogAction>Continue</AlertDialogAction>
    </AlertDialogFooter>
  </AlertDialogContent>
</AlertDialog>

API reference

This component is built on top of Radix UI Alert Dialog. For additional props and detailed API documentation, refer to the Radix documentation.