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>
  <AlertDialogPortal>
    <AlertDialogOverlay />
    <AlertDialogContent>
      <AlertDialogHeader>
        <AlertDialogTitle>Alert Dialog Title</AlertDialogTitle>
        <AlertDialogDescription>
          Alert Dialog Description
        </AlertDialogDescription>
      </AlertDialogHeader>
      <AlertDialogFooter>
        <AlertDialogAction>Accept</AlertDialogAction>
        <AlertDialogClose>Close</AlertDialogClose>
      </AlertDialogFooter>
    </AlertDialogContent>
  </AlertDialogPortal>
</AlertDialog>

API Reference

AlertDialog

Radix UI API Reference - AlertDialog.Root

AlertDialogTrigger

Radix UI API Reference - AlertDialog.Trigger

AlertDialogPortal

Radix UI API Reference - AlertDialog.Portal

The forceMount property is not supported in the AlertDialogPortal component, as it is used for animation.

AlertDialogOverlay

Radix UI API Reference - AlertDialog.Overlay
PropTypeDefault
transition?
Transition
{ duration: 0.2, ease: 'easeInOut' }
...props?
HTMLMotionProps<"div">
-

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

AlertDialogContent

Radix UI API Reference - AlertDialog.Content
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.

AlertDialogAction

Radix UI API Reference - AlertDialog.Action

AlertDialogCancel

Radix UI API Reference - AlertDialog.Cancel

AlertDialogHeader

PropTypeDefault
...props?
React.ComponentProps<'div'>
-

AlertDialogTitle

Radix UI API Reference - AlertDialog.Title

AlertDialogDescription

Radix UI API Reference - AlertDialog.Description

AlertDialogFooter

PropTypeDefault
...props?
React.ComponentProps<'div'>
-

Credits

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