Animated Dialog

A composable, highly accessible dialog modal built on Base UI Dialog primitives and styled with Motion. It supports directional slide transitions (animating from the top, bottom, left, right, or center).

Features

  • Directional Entrance & Exit — Configure modal transitions (from / exitTo) to slide from different vector origins.
  • Responsive Motion — Uses short, interruptible transitions for the surface and backdrop, without overshoot on modal entrance.
  • Standard Composable API — Compose layouts with AnimatedDialog, Trigger, Content, Title, Description, and Close.
  • Portal & Accessibility — Handles focus locking, scroll trapping, screen-readers, and rendering overlays cleanly via Base UI.
  • Controlled or uncontrolled — Use open/onOpenChange or defaultOpen as needed.
  • RTL & SSR Safe — Hydrates styles without layout shifting.
  • Reduced Motion — Seamlessly bypasses physical slide translations to fade in/out instantly.

Playground

Explore different slide options live.

Controls
Controls

Installation

Usage

Code Examples

Directional Slide

Choose how the content surfaces by setting the from and exitTo options.

TypeScript
directional-modal.tsx

Center Scale

Configure from="center" for standard modal zoom-fade effects.

TypeScript
center-modal.tsx

Action Toasts

Trigger notifications on confirmation or cancellation actions.

Props

PropertyTypeDefaultDescription
childrenReactNoderequired
openboolean
defaultOpenbooleanfalseInitial open state for uncontrolled usage.
onOpenChange(open: boolean) => void
modalbooleantrueWhether the dialog traps interaction inside the modal.