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 @aceternity/animated-modal

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

Next.js 15, Tailwind CSS v4 and Motion for react powered templates

70+ templates and component blocks combined

Ready to copy paste component blocks, save days of development time

Aceternity UI Pro Demo - Light Mode
A product by Aceternity
Building in public at @mannupaaji