Skip to content

Design5 min read

How to Create a Native Modal in Webflow Without a Plugin

Learn how to create a native modal pop-up in Webflow without a plugin: overlay, click-to-open, and close.

In this tutorial, Sandro, cofounder of Gemeos Webflow agency, shows you how to create a native modal pop-up in Webflow without a plugin, with open-on-click and close-by-clicking-the-overlay behavior.

Example

Confirm action

Click outside, hit Cancel, or press Escape to close.

ElementCSS classRole
Overlaymodal-overlaySemi-transparent background that covers the entire page
Modal boxmodal-boxThe modal content
Open buttonopen-modalOpen trigger
Close buttonclose-modalCloses the modal

1. Create the modal structure

Create a Div modal-overlay with position Fixed, covering the entire page (top/left/right/bottom: 0), background rgba(0,0,0,0.5), display: none, z-index: 1000. Inside it, add a centered Div modal-box (margin: auto). Add a close-modal button inside the modal-box. Create an open-modal button somewhere else on your page.

2. Add this script in the <body>

const overlay = document.querySelector('.modal-overlay');
document.querySelector('.open-modal').addEventListener('click', function() {
  overlay.style.display = 'flex';
  document.body.style.overflow = 'hidden';
});
document.querySelector('.close-modal').addEventListener('click', function() {
  overlay.style.display = 'none';
  document.body.style.overflow = '';
});
overlay.addEventListener('click', function(e) {
  if (e.target === overlay) {
    overlay.style.display = 'none';
    document.body.style.overflow = '';
  }
});

Conclusion

A native modal improves conversions and UX without weighing down your site. Use cases:

  • Contact or demo form
  • Action confirmation (deletion, purchase)
  • Lightbox image gallery

Published on May 19, 2026

Sandro DA SILVA

Growth Marketer, Webflow expert, and jack-of-all-trades. Sandro handles commercial operations, ensures projects run smoothly, and addresses marketing-related issues (SEO, Tracking, Copywriting, etc).

You're going to working with us, guaranteed

Ready to launch your business?

get a quote

Let’s f*****G GO !!