Loading
Loading
Loading
mobile footer

Build the Interaction Layer Your Website is Missing.

Browse All EffectsBrowse All EffectsBrowse All EffectsUpgrade to ProUpgrade to ProUpgrade to Pro

70+ effects free, forever. No credit card.

© 2026 Hyperiux. All Rights Reserved.

AI Component CatalogueHey AI, Learn About Us
Platform

Vault

  • Documentation
  • Pricing
  • Blog
  • Community
  • NPM
  • MCP

Categories

  • All Effects
  • WebGL
  • Text
  • Backgrounds
  • Buttons
  • Carousels
  • Scroll
  • Components
  • Navigation
  • Cursor
  • Transitions
  • Loaders

Documents

  • Introduction
  • Installation
  • CLI
  • Dependencies
  • License

Legal

  • License Agreement
  • Terms of Service
  • Privacy Policy
  • Refund Policy
Socials
  • Twitter / X
  • LinkedIn
  • GitHub
  • Instagram
Contact Us
  • hello@hyperiux.com
New effects, in your inbox

Every new drop, plus the occasional behind-the-scenes build. No spam. Unsubscribe anytime.

All Effects
Featured ComponentsText AnimationsAnimated BackgroundsAnimated ButtonsCarousel EffectsScroll EffectsCreative ComponentsNavigationsCursor EffectsTransitionsLoadersWebGL & 3D Effects
Templates
IntroductionInstallationCLIDependenciesLicense
PricingBlogGithubNPMMCP Doc
Loading
Home/effects/Animated Modal

Animated Modal

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

Lucide-react
DemoDemoDemo

Tune the Real Props

Background Color

Modal content background color.

Text Color

Modal content text color.

Overview

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.


Usage Code

page
1import AnimatedModal from "@/components/effects/animated-modal";2 3export default function Page() {4  return (5    <>6          <AnimatedModal/>7    </>8  );9}

Example Production Use Case

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.


Best Used For

  • Short dialogs where temporary focus helps the task.
  • Demo previews, confirmation steps, compact forms, and media lightboxes with clear close behavior.
  • Desktop interactions that can become drawers or inline sections on mobile.

Not For

Not for long pages, dense forms, core pricing details, or content that would work better as an inline section or drawer.


Performance Budget

Mount heavy modal content only when needed, keep open/close transitions short, and avoid blocking route or scroll restoration after close.


Accessibility and Mobile

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.


Common Mistakes

  • Opening a modal without a clear title or accessible label.
  • Failing to return focus to the trigger.
  • Putting long task flows inside a cramped dialog.

Changelog

Added reduced motion support.
Initial release

API Reference

PropTypeDefaultDescription
showCloseButtonbooleantrueShows the close (X) button.
closeOnBackdropbooleantrueCloses the modal when the backdrop is clicked.
closeOnEscbooleantrueCloses the modal when Escape is pressed.
sizenumber72Modal content width as a percentage of the viewport, capped at 960px.
overlayOpacitynumber0.82Opacity of the page overlay.
durationnumber0.5Open and close fade duration in seconds.
backgroundColorcolor#ffffffModal content background color.
textColorcolor#111111Modal content text color.
roundednessnumber24Modal content border radius in pixels.

Questions, Answered.

Which accessibility details are non-negotiable for Animated Modal?

A labelled dialog, focus trap, Escape close, focus restore, visible close control, and scroll lock where supported.

When should Animated Modal become inline on mobile?

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.

What should reduced motion do?

Remove scale, blur, and dramatic movement. The dialog can appear instantly or with a short opacity change.

Can Hyperiux adapt Animated Modal for a real brand system?

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.

Request a Custom Animation

Need a custom effect? Tell us what to create.

Related Effects

Explore All EffectsExplore All EffectsExplore All Effects
Arrow Fill Button
Lucide-react

Arrow Fill Button

Buttons

Animated Toggle
Pro
CSS

Animated Toggle

Buttons

Animated FAQ
motionLucide-react

Animated FAQ

Components

Animated Form
Pro
zod

Animated Form

Components