Animate UI

Alert Dialog

A dialog that requires user response to proceed.

Made by imskyleen
Edit on GitHub

Installation

Usage

<AlertDialog>
  <AlertDialogTrigger>Open Dialog</AlertDialogTrigger>
  <AlertDialogPortal>
    <AlertDialogBackdrop />
    <AlertDialogPopup>
      <AlertDialogHeader>
        <AlertDialogTitle>Alert Dialog Title</AlertDialogTitle>
        <AlertDialogDescription>
          Alert Dialog Description
        </AlertDialogDescription>
      </AlertDialogHeader>
      <AlertDialogFooter>
        <AlertDialogClose render={<button>Cancel</button>} />
        <button>Continue</button>
      </AlertDialogFooter>
    </AlertDialogPopup>
  </AlertDialogPortal>
</AlertDialog>

API Reference

AlertDialog

Base UI API Reference - AlertDialog.Root

AlertDialogTrigger

Base UI API Reference - AlertDialog.Trigger

AlertDialogPortal

Base UI API Reference - AlertDialog.Portal

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

AlertDialogOverlay

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

The render property is not supported in the AlertDialogBackdrop component, as it is used for animation.

AlertDialogPopup

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

The render property is not supported in the AlertDialogPopup component, as it is used for animation.

AlertDialogClose

Base UI API Reference - AlertDialog.Close

AlertDialogHeader

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

AlertDialogTitle

Base UI API Reference - AlertDialog.Title

AlertDialogDescription

Base UI API Reference - AlertDialog.Description

AlertDialogFooter

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

Credits

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