Introducing Aceternity UI Pro - 70+ premium component packs and templates to build amazing websites.
Logo

Animated Modal

A customizable, compound modal component with animated transitions

Open in

Installation

Run the following command

npx shadcn@latest add https://ui.aceternity.com/registry/animated-modal.json

props

ModalProvider

PropTypeDescription
childrenReactNodeThe content to be wrapped by the provider.
PropTypeDescription
childrenReactNodeThe content to be displayed inside the modal.

ModalTrigger

PropTypeDescription
childrenReactNodeThe content to be displayed inside the trigger button.
classNamestring?Optional additional class names for the trigger button.

ModalBody

PropTypeDescription
childrenReactNodeThe content to be displayed inside the modal body.
classNamestring?Optional additional class names for the modal body.

ModalContent

PropTypeDescription
childrenReactNodeThe content to be displayed inside the modal content.
classNamestring?Optional additional class names for the modal content.

ModalFooter

PropTypeDescription
childrenReactNodeThe content to be displayed inside the modal footer.
classNamestring?Optional additional class names for the modal footer.

Overlay

PropTypeDescription
classNamestring?Optional additional class names for the overlay.

useOutsideClick

PropTypeDescription
refReact.RefObject<HTMLDivElement>The reference to the element to detect outside clicks.
callbackFunctionThe callback function to be called when an outside click is detected.

Build websites faster and 10x better than your competitors with Aceternity UI Pro

With the best in class components and templates, stand out from the crowd and get more attention to your website. Trusted by founders and entrepreneurs from all over the world.

Go Pro
Manu was quick to respond, very professional, and delivered a website within a week. Very good job. Looking forward to collaborating again

Asriel Han

Founder, CTO at Advex AI

A product by Aceternity
Building in public at @mannupaaji