Mai Popups
A lightweight and flexible popup, slideup, notice, and hello bar block.
★ 1stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/maithemewp/mai-popups/archive/refs/heads/develop.zipFrom the readme
Mai Popups
A lightweight and flexible popup, slide-up, notice, and hello-bar block, built on the native element. Works best with Mai Theme, but should work in any block-based theme.
Centered popups render as accessible modals (native focus trap, inert background, Esc to close, and a dimmed ::backdrop). Positioned popups (top/bottom/corner) render as non-modal bars and slide-ins.
Requirements
- WordPress 6.9+
- PHP 8.2+
- ACF Pro 6+
Usage
Mai Popup block
Add the Mai Popup block to any post or page and build the popup content with any blocks. Configure behavior (trigger, animation, position, width, padding, repeat, colors, etc.) in the block settings sidebar.
Open a popup from a link
Give the popup an id (it must start with mai-popup-, e.g. mai-popup-newsletter) and link to it from anywhere:
Any link whose href starts with #mai-popup- opens the matching popup. Manually opening a popup this way never sets the repeat cookie, so it always works.
Disable closing
The "Disable closing" setting removes the close button and disables click-outside-to-close. To let users close it, place a link or button with the class mai-popup-close inside the popup:
Helper function
Developers