Marketing · Gutenberg
Popup block for WordPress
Popup/lightbox builder with a configurable trigger button and rich popup content — heading, text, image, CTA and close. Supports click, scroll-depth, time-delay and exit-intent triggers.
Get Blockenberg
Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.
What it actually does
Popup/lightbox builder with a configurable trigger button and rich popup content — heading, text, image, CTA and close. Supports click, scroll-depth, time-delay and exit-intent triggers.
Inspector panels on this block: Trigger Button, Trigger Type, Popup Layout, Image, CTA & Dismiss. Those titles come from index.js, not from a shared template.
Behavior controls: “Button Style” options: Filled, Outline, Ghost; “Button Size” options: Small, Medium, Large; “Button Alignment” options: Left, Center, Right; “When to Show” options: Button Click, Scroll Depth, Time Delay, Exit Intent.
Where to find it
Gutenberg inserter → Marketing → search “Popup” (block name `blockenberg/popup` in block.json). Style it in the sidebar after insert.
How to use Popup block for WordPress
- Install Blockenberg. Install from WordPress.org and activate the plugin.
- Insert the block. Edit a page, click +, search for “Popup”, insert it. Category: Marketing.
- Configure inspector controls that exist on this block. Open Trigger Button. Set “Button Label”, “Button Style”, “Button Size”, “Button Alignment”.
- Check the published page. The view script reads HTML data attributes: data-opts, data-rendered, data-uid. The block editor preview may not run the same view script.
Inspector controls from this block’s code
| Control | What the code does |
|---|---|
| Button Label | Text field in the inspector. block.json default: Open Popup. Saved as `triggerLabel`. |
| Button Style | Select control; the chosen value is saved on the block. Options: Filled; Outline; Ghost. block.json default: filled. Saved as `triggerStyle`. |
| Button Size | Select control; the chosen value is saved on the block. Options: Small; Medium; Large. block.json default: md. Saved as `triggerSize`. |
| Button Alignment | Select control; the chosen value is saved on the block. Options: Left; Center; Right. block.json default: center. Saved as `triggerAlign`. |
| When to Show | Select control; the chosen value is saved on the block. Options: Button Click; Scroll Depth; Time Delay; Exit Intent. block.json default: click. Saved as `triggerType`. |
| Scroll Depth (%) | Numeric range control in the inspector. Range 10–100. block.json default: 40. Saved as `scrollDepth`. |
| Delay (seconds) | Numeric range control in the inspector. Range 1–30. block.json default: 3. Saved as `timeDelay`. |
| Show Frequency | Select control; the chosen value is saved on the block. Options: Always; Once per Session; Once Ever. block.json default: always. Saved as `showOnce`. |
| Position | Select control; the chosen value is saved on the block. Options: Center; Drawer — Right; Drawer — Bottom. block.json default: center. Saved as `popupPosition`. |
| Popup Layout — Size | Select control; the chosen value is saved on the block. Options: Small; Medium; Large; Custom. block.json default: md. Saved as `popupSize`. |
| Custom Width (px) | Numeric range control in the inspector. Range 300–1000. block.json default: 560. Saved as `popupWidth`. |
| Animation | Select control; the chosen value is saved on the block. Options: Scale; Fade; Slide Up; Slide Right. block.json default: scale. Saved as `popupAnimation`. |
| Border Radius (px) | Numeric range control in the inspector. Range 0–40. block.json default: 16. Saved as `borderRadius`. |
| Close on Overlay Click | On/off toggle in the inspector. On by default. Saved as `closeOnOverlay`. |
| Show Close Button | On/off toggle in the inspector. On by default. Saved as `showCloseBtn`. |
| Overlay Opacity (%) | Numeric range control in the inspector. Range 10–95. block.json default: 60. Saved as `overlayOpacity`. |
| Image Position | Select control; the chosen value is saved on the block. Options: Top; Left; Right; None. block.json default: top. Saved as `imagePosition`. |
| Show CTA Button | On/off toggle in the inspector. On by default. Saved as `showCta`. |
| CTA Label | Text field in the inspector. block.json default: Claim Your Discount. Saved as `ctaLabel`. |
| CTA URL | Text field in the inspector. block.json default: #. Saved as `ctaUrl`. |
| Open in New Tab | On/off toggle in the inspector. Off by default. Saved as `ctaNewTab`. |
| CTA Style | Select control; the chosen value is saved on the block. Options: Filled; Outline. block.json default: filled. Saved as `ctaStyle`. |
| Show Dismiss Link | On/off toggle in the inspector. On by default. Saved as `showDismiss`. |
| Dismiss Label | Text field in the inspector. block.json default: No thanks. Saved as `dismissLabel`. |
| Padding Top (px) | Numeric range control in the inspector. Range 0–240. block.json default: 0. Saved as `paddingTop`. |
| Padding Bottom (px) | Numeric range control in the inspector. Range 0–240. block.json default: 0. Saved as `paddingBottom`. |
| Heading Typography | Shared Blockenberg typography popover (family, size, weight, spacing). Saved as `headingTypo`. |
| Body Typography | Shared Blockenberg typography popover (family, size, weight, spacing). Saved as `bodyTypo`. |
| Trigger Button BG | Color control in the inspector. block.json default: #6366f1. Saved as `triggerBg`. |
| Trigger Button Text | Color control in the inspector. block.json default: #ffffff. Saved as `triggerColor`. |
| Overlay Color | Color control in the inspector. block.json default: #000000. Saved as `overlayColor`. |
| Popup Background | Color control in the inspector. block.json default: #ffffff. Saved as `popupBg`. |
| Heading | Color control in the inspector. block.json default: #111827. Saved as `headingColor`. |
| Body Text | Color control in the inspector. block.json default: #4b5563. Saved as `textColor`. |
| CTA Button BG | Color control in the inspector. block.json default: #6366f1. Saved as `btnBg`. |
| CTA Button Text | Color control in the inspector. block.json default: #ffffff. Saved as `btnColor`. |
| Dismiss Text | Color control in the inspector. block.json default: #9ca3af. Saved as `dismissColor`. |
What the front-end script actually does
- The view script reads HTML data attributes: data-opts, data-rendered, data-uid.
- It writes to localStorage in the visitor’s browser, not to wp_options.
- It uses sessionStorage (tab session only).
- Keyboard handlers move focus between items.
When this is the right block
- Popup/lightbox builder with a configurable trigger button and rich popup content — heading, text, image, CTA and close. Supports click, scroll-depth, time-delay and exit-intent triggers — that is the job of Popup, not a generic content block.
- Use it when you need the editor control labeled “Button Label”, which exists on this block’s inspector.
- It matches pages about popup, modal, lightbox.
- Inserter grouping: landing pages, campaign sections, and conversion layouts.
Notes from the implementation
viewScript: this folder’s frontend.js is enqueued on the front end for this block.
FAQ
How do I add the Popup block in WordPress?
Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Popup”. It sits under Marketing. After insert, open Trigger Button and set “Button Label”, “Button Style”, “Button Size”, “Button Alignment”.
Where does Popup store visitor state?
In localStorage on that browser. Clearing site data resets it. It is not a WordPress user meta field unless render.php says so.
Is the Popup Gutenberg block free?
Yes. Popup ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.
Can I style Popup to match my theme?
Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: Trigger Button, Trigger Type, Popup Layout, Image).
Related marketing blocks
Newsletter Popup
Email capture popup that triggers on scroll, time delay, or exit intent. Cookie-based dismissal, image support, and success state.
Social Proof Popup
Floating FOMO notification popups that cycle through social proof entries like purchases, signups, and reviews.
Affiliate Disclosure
Styled FTC-compliant affiliate link disclosure notice for articles and reviews. Distinct from Affiliate Review Box — this is the small legal notice, not a full product review.
Affiliate Review Box
Structured product review block with score badge, pros & cons columns, verdict summary, price display, and affiliate CTA button.
Affiliate Section
Affiliate/referral program landing section with commission highlight, how-it-works steps, benefits list, and stats.
Age Gate
Age verification overlay that protects page content behind a customizable age confirmation dialog.
Get Blockenberg
Install Blockenberg from WordPress.org, then insert Popup from the Gutenberg inserter.