AlertDialog

overlays

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

Preview

Installation

npm install @launchapp/design-system
Import
import {  AlertDialogRoot, AlertDialogTrigger, AlertDialogContent,  AlertDialogHeader, AlertDialogFooter, AlertDialogTitle,  AlertDialogDescription, AlertDialogAction, AlertDialogCancel} from "@launchapp/design-system";

Examples

Basic AlertDialog

<AlertDialogRoot>  <AlertDialogTrigger asChild>    <Button variant="destructive">Delete account</Button>  </AlertDialogTrigger>  <AlertDialogContent>    <AlertDialogHeader>      <AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>      <AlertDialogDescription>        This action cannot be undone.      </AlertDialogDescription>    </AlertDialogHeader>    <AlertDialogFooter>      <AlertDialogCancel>Cancel</AlertDialogCancel>      <AlertDialogAction>Continue</AlertDialogAction>    </AlertDialogFooter>  </AlertDialogContent></AlertDialogRoot>

Props

PropTypeDefaultDescription
open
booleanControlled open state.
onOpenChange
(open: boolean) => voidCallback when open state changes.
defaultOpen
booleanfalseInitial open state when uncontrolled.