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>
  <DialogPortal>
    <DialogOverlay />
    <DialogContent>
      <DialogHeader>
        <DialogTitle>Dialog Title</DialogTitle>
        <DialogDescription>Dialog Description</DialogDescription>
      </DialogHeader>
      <p>Dialog Content</p>
      <DialogFooter>
        <button>Accept</button>
      </DialogFooter>
      <DialogClose>Close</DialogClose>
    </DialogContent>
  </DialogPortal>
</Dialog>

API Reference

Dialog

Radix UI API Reference - Dialog.Root

DialogTrigger

Radix UI API Reference - Dialog.Trigger

DialogPortal

Radix UI API Reference - Dialog.Portal

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

DialogOverlay

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

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

DialogContent

Radix UI API Reference - Dialog.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 DialogContent component, as it is used for animation.

DialogClose

Radix UI API Reference - Dialog.Close

DialogHeader

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

DialogTitle

Radix UI API Reference - Dialog.Title

DialogDescription

Radix UI API Reference - Dialog.Description

DialogFooter

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

Credits

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