ToolypetMCP
intermediate4 minutescss

Modal Overlay Design

Design a modal dialog with backdrop blur, centered layout, entrance animation, and shadow.

modaloverlayanimationblur

इस रेसिपी का उपयोग कब करें

Modals are essential for confirmations, forms, image lightboxes, and notifications. This recipe creates a professional modal that feels smooth and polished.

चरण

1

Create the dimmed blur overlay

प्रॉम्प्ट:Generate backdrop-filter: blur(8px) brightness(0.7) for a modal overlay background
2

Center the modal on screen

प्रॉम्प्ट:Generate flexbox CSS to center a modal both horizontally and vertically
3

Add prominent shadow for depth

प्रॉम्प्ट:Generate a large shadow for modal: 0 20px 60px rgba(0,0,0,0.3)
4

Smooth entrance animation

प्रॉम्प्ट:Generate a scale-in animation from scale(0.9) opacity(0) to scale(1) opacity(1) over 200ms ease-out

अक्सर पूछे जाने वाले प्रश्न

How do I close the modal when clicking the overlay?

Add an onClick handler to the overlay element that calls your close function. Make sure to use event.stopPropagation() on the modal content.

How do I prevent body scrolling when modal is open?

Add overflow: hidden to the body element when the modal opens, and remove it when it closes.

संबंधित रेसिपी