humanmade / hm-popup-block
An popup and tooltip dialog block utility, multiple trigger options, and supports anchor placements
Package info
github.com/humanmade/hm-popup-block
Language:JavaScript
Type:wordpress-plugin
pkg:composer/humanmade/hm-popup-block
Requires
- composer/installers: ^1 || ^2
Replaces
This package is auto-updated.
Last update: 2026-08-12 18:56:43 UTC
README
A lightweight, modern popup block for WordPress that displays any content as a modal dialog.
Features
Trigger Modes
- Click trigger - Open popup from any link or button by setting the URL to
#your-popup-id - Exit intent - Automatically show popup when user moves cursor to leave the page
Display Styles
- Centered modal - Default full-screen overlay with centered content
- Left sidebar - Slide-in panel from the left edge
- Right sidebar - Slide-in panel from the right edge
Anchor Positioning
Position popups relative to their trigger button using CSS anchor positioning:
- Bottom / Bottom Start / Bottom End
- Top / Top Start / Top End
- Left / Left Start / Left End
- Right / Right Start / Right End
Anchored popups automatically reposition when they would overflow the viewport.
Styling Options
- Customizable backdrop opacity (0-100%)
- Backdrop background color support
- Backdrop background image support
- Full layout controls for popup content width
Accessibility
- Built on native HTML
<dialog>element - Keyboard accessible (Escape to close)
- Click backdrop to close
- Add close buttons with
#closeURL
Usage
- Add a Popup Block to your page
- Set an anchor/ID for the popup (e.g.,
my-popup) - Add your content inside the popup
- Create a button or link with URL
#my-popupto trigger it
Exit Intent Popup
- Add a Popup Block and set trigger to "On exit intent"
- Configure cookie expiration (days before showing again)
- The popup will appear when users move to leave the page
Anchored Popup
- Add a Popup Block with click trigger
- Enable "Use Anchoring" in block settings
- Select anchor position (bottom, top, left, right, etc.)
- The popup will appear attached to the trigger button
Requirements
- WordPress 6.1+
- PHP 7.0+
Release Process
Releases are cut by the Release GitHub Actions workflow
(.github/workflows/release.yml), triggered manually from the Actions tab.
The workflow does everything before the tag exists, then creates the tag once and never touches it again — this keeps every tag immutable, which is what Packagist requires (it rejects tag updates).
Creating a release
- Make sure
mainis green and contains the code you want to ship. - Go to Actions → Release → Run workflow.
- Enter the version without a leading
v(e.g.1.2.3). - Run it.
The workflow will then:
- Validate the version (must be
X.Y.Z) and fail fast if thevX.Y.Ztag already exists. - Build the production assets (
npm ci && npm run build). - Stamp the version into
popup.php, replacing the__VERSION__placeholder. - Commit the built assets and stamped version, create an annotated tag
vX.Y.Zpointing at that commit, and push the tag — once, never force-pushed. - Build the distribution ZIP with
npm run plugin-zip(popup.zip) and publish a GitHub release with auto-generated notes.
The version on main is always the literal placeholder __VERSION__; the real
number only ever exists inside a release tag. Follow
Semantic Versioning. Because tags are immutable, if a
release was wrong, publish a new patch version rather than trying to move a
tag.
License
GPL-2.0-or-later