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, andClose. - Portal & Accessibility — Handles focus locking, scroll trapping, screen-readers, and rendering overlays cleanly via Base UI.
- Controlled or uncontrolled — Use
open/onOpenChangeordefaultOpenas 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.
Installation
Usage
Code Examples
Directional Slide
Choose how the content surfaces by setting the from and exitTo options.
directional-modal.tsx
Center Scale
Configure from="center" for standard modal zoom-fade effects.
center-modal.tsx
Action Toasts
Trigger notifications on confirmation or cancellation actions.
Props
| Property | Type | Default | Description |
|---|---|---|---|
children | ReactNode | required | |
open | boolean | — | |
defaultOpen | boolean | false | Initial open state for uncontrolled usage. |
onOpenChange | (open: boolean) => void | — | |
modal | boolean | true | Whether the dialog traps interaction inside the modal. |