Animate UI

Dialog

A window overlaid on either the primary window or another dialog window, rendering the content underneath inert.

Made by imskyleen
Edit on GitHub

Installation

Usage

<Dialog>
  <DialogTrigger>Open Dialog</DialogTrigger>
  <DialogContent>
    <DialogHeader>
      <DialogTitle>Dialog Title</DialogTitle>
      <DialogDescription>Dialog Description</DialogDescription>
    </DialogHeader>
    <p>Dialog Content</p>
    <DialogFooter>
      <button>Accept</button>
    </DialogFooter>
  </DialogContent>
</Dialog>

API Reference

Dialog

DialogTrigger

DialogContent

PropTypeDefault
showCloseButton?
boolean
true
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 DialogContent component, as it is used for animation.

DialogClose

DialogHeader

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

DialogTitle

DialogDescription

DialogFooter

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

Credits

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