Animate UI

Alert Dialog

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

Made by imskyleen
Edit on GitHub

Installation

Usage

<AlertDialog>
  <AlertDialogTrigger>Open Dialog</AlertDialogTrigger>
  <AlertDialogContent>
    <AlertDialogHeader>
      <AlertDialogTitle>Alert Dialog Title</AlertDialogTitle>
      <AlertDialogDescription>Alert Dialog Description</AlertDialogDescription>
    </AlertDialogHeader>
    <AlertDialogFooter>
      <AlertDialogCancel>Cancel</AlertDialogCancel>
      <AlertDialogAction>Accept</AlertDialogAction>
    </AlertDialogFooter>
  </AlertDialogContent>
</AlertDialog>

API Reference

AlertDialog

AlertDialogTrigger

AlertDialogContent

PropTypeDefault
from?
'top' | 'bottom' | 'left' | 'right'
top
transition?
Transition
{ type: 'spring', stiffness: 150, damping: 25 }
...props?
HTMLMotionProps<"div">
-

The asChild and forceMount properties are not supported in the AlertDialogContent component, as it is used for animation.

AlertDialogCancel

AlertDialogHeader

Animate UI API Reference - Alert Dialog Header Primitive
PropTypeDefault
...props?
React.ComponentProps<'div'>
-

AlertDialogTitle

AlertDialogDescription

AlertDialogFooter

Animate UI API Reference - Alert Dialog Footer Primitive
PropTypeDefault
...props?
React.ComponentProps<'div'>
-

Credits

Built by Skyleen. The source code is available on GitHub.