Newsletter Form V04

Author: Colorlib
Released: September 2026
License: CC BY 3.0
A colourful subscribe popup for a plant shop that offers 15% off the first order, built on the native dialog element with showModal(). It opens from a button and also by itself after a delay set in a data-delay attribute, and a Don't show this again checkbox stores a flag in localStorage so the automatic open is skipped on later visits. Focus moves to the email field on open and returns to the opener on close, and Esc, the close button and a backdrop click all close it.
It is plain HTML and CSS plus a few lines of vanilla JavaScript: no jQuery, no Bootstrap files, no plugins, and the download is 77 KB. Use it on its own, or drop it into a Bootstrap 4, 5 or 6 project and it looks the same.
- Native dialog with showModal(), Esc and backdrop-click close
- Automatic open after a configurable data-delay
- Don't show this again flag stored in localStorage with a safe fallback
- Focus moves into the dialog and returns to the opener
- Inline email validation and a coupon-code success state
- Illustration panel stacks above the form on phones

