A focus-managed dialog component for confirmations, demo previews, compact forms, media lightboxes, and contextual help.

Animated Modal is a labelled dialog pattern with motion added after focus, Escape, scroll lock, and restore behavior are solved.
Use it for short, interruptive tasks where a dialog is genuinely better than an inline section: confirmation, demo preview, compact form, media lightbox, or contextual help. The page job is temporary focus, not hiding depth.
The risk in production is broken focus. The dialog must be labelled, focus-trapped while open, closable with Escape, and return focus to the trigger.
You can preview it now. Upgrade to Pro for instant install access.
You can preview it now. Upgrade to Pro for instant install access.
You can preview it now. Upgrade to Pro for instant install access.
A product page can use Animated Modal for a short demo preview or confirmation flow when the trigger remains obvious and closing returns the visitor to the exact point of action.
Not for long pages, dense forms, core pricing details, or content that would work better as an inline section or drawer.
Mount heavy modal content only when needed, keep open/close transitions short, and avoid blocking route or scroll restoration after close.
Label the dialog, trap focus only while open, close with Escape when safe, and restore focus to the trigger. On mobile, use a drawer or inline section when the content is long.
| Prop | Type | Default | Description |
|---|---|---|---|
showCloseButton | boolean | true | Shows the close (X) button. |
closeOnBackdrop | boolean | true | Closes the modal when the backdrop is clicked. |
closeOnEsc | boolean | true | Closes the modal when Escape is pressed. |
size | number | 72 | Modal content width as a percentage of the viewport, capped at 960px. |
overlayOpacity | number | 0.82 | Opacity of the page overlay. |
duration | number | 0.5 | Open and close fade duration in seconds. |
backgroundColor | color | #ffffff | Modal content background color. |
textColor | color | #111111 | Modal content text color. |
roundedness | number | 24 | Modal content border radius in pixels. |
A labelled dialog, focus trap, Escape close, focus restore, visible close control, and scroll lock where supported.
When the content is long, form-heavy, or central to the task. A cramped mobile modal is usually worse than a drawer or inline section.
Remove scale, blur, and dramatic movement. The dialog can appear instantly or with a short opacity change.
Yes. A custom version should define content structure, accessibility behavior, motion rules, reduced-motion behavior, source handoff, and implementation notes for the specific page job.
Need a custom effect? Tell us what to create.