Build a custom video popup in Webflow that just works: click a trigger and it fades in with the video already playing, click outside the video (or the close button) and it fades out and pauses. No writing code — the entire thing is driven by a handful of custom attributes, so you configure everything straight from Webflow’s settings panel.
And it goes further than a single popup. You can add as many open triggers as you want, run several different popups on one page, set the fade’s easing and duration, then turn the whole thing into a component and bind it to the CMS — so each project or collection item shows its own video and thumbnail.
The nicest part is how little you have to think about. Your class names and naming convention are completely irrelevant; the script only ever looks at the attributes. Label the pieces, drop in your Vimeo link, and you’re done.
How it works
The popup is one overlay element carrying fc-video-popup="component". It’s position: fixed, covers the whole viewport, sits at a high z-index, and starts at display: none so it’s hidden until triggered. Two optional attributes tune the animation: easing sets the fade’s easing curve (defaulting to ease) and duration sets its length in milliseconds (defaulting to 300). Neither is required — leave them off and the sensible defaults kick in.
Inside the overlay, the same attribute name does every job — only the value changes. A full-bleed close overlay sits behind the video with fc-video-popup="close", and the actual close button carries that same value, so a click anywhere outside the video dismisses the popup. The custom play button (which fades in if you pause the video) gets fc-video-popup="play". And any element on the page you want to open the popup — a link block, a button, whatever — gets fc-video-popup="open". That’s the whole mental model: one attribute, four roles.
The video itself is a Webflow custom element switched to the iframe tag (set the tag to iframe in the element settings). Its src is the most important value in the setup, and right now the solution is built for Vimeo: open the video on Vimeo, hit Share, open the embed tag, and copy the link up to the first question mark. That trimmed URL is what goes in src. The iframe also keeps a frameborder and an allow attribute — you don’t need to understand the allow value, just leave it as-is so the embed behaves.
Two gotchas are worth internalizing. First, multiple popups on one page: duplicate the overlay and bump its value to component-2, component-3, and so on, wiring each trigger with open — but the script embed defines shared variables, so a duplicate script conflicts with itself. Keep exactly one script on the page and delete the others. Second, once you make it a component, expose the pieces you want to vary — the component name (the fc-video-popup value), easing, duration, the iframe src, the thumbnail, and the script’s visibility — as component properties, then hide the extra scripts via that visibility property when you place more than one instance.
How to use it
-
Clone the project. Grab the Webflow cloneable — it ships with the full structure, styling, and the commented popup script, plus an attributes reference at the bottom of the page. It’s built on the free ScrollVibe template.
-
Point it at your video. Select the iframe inside the iframe wrapper and set its
srcto your Vimeo embed URL — copy the link from Vimeo’s embed tag and trim it right before the first?. -
Add a trigger. On any element that should open the popup, add
fc-video-popup="open". You can add this to as many elements as you like; they’ll all open the same popup. -
Tune the animation (optional). On the popup overlay, add
easingwith a value from the MDN easing-function reference and/ordurationin milliseconds. Skip them and you geteaseat300ms. -
Add more popups on the page. Duplicate the overlay, change its value to
component-2(thencomponent-3…), give its triggerfc-video-popup="open", and swap in a different video source and thumbnail. Then delete every popup script except the last one so they don’t conflict. -
Make it a component + CMS. Right-click the overlay and create a component. Expose the component name, easing, duration, iframe
src, thumbnail, and script visibility as properties. To drive it from the CMS, bind the video link to a plain-text field (not a link field) and the thumbnail to an image field — publish, and each item plays its own video.