Skip to main content

Popup

A popup project makes popups for websites: sign-up boxes, offers, notices. Your users design the box and choose when it appears; you place the result on any site.

What your users choose​

SettingChoices
PositionNine places: the four corners, the middle of each side, or the centre
SizeWidth (up to 1200px) and, if wanted, a fixed height; on a phone it keeps a margin and its columns stack
OverlayThe colour behind it, see-through for none (then the page behind stays usable), and whether a click on it closes the popup
Close buttonShown or not, and its colours
OpensWhen the page loads (after a delay in seconds), when the visitor scrolls past a share of the page, when they move to leave (desktop), or only when your code opens it
How oftenEvery page view, once per browser session, or once ever

A popup can hold any block a landing page can, forms included.

Placing it on a site​

exportHtml() gives a whole HTML document; for a site, use its pieces:

const { designId, chunks } = await editor.exportHtml();
// chunks.body — the popup's markup chunks.css — its styles
// chunks.js — the script that opens it on its trigger, closes it, and keeps focus inside it
<!-- anywhere in your site's pages -->
<style>/* chunks.css */</style>
<!-- chunks.body -->
<script>/* chunks.js */</script>

Everything is scoped to the popup: its styles reach nothing else on your page, and two popups on one page never clash. Until its trigger, it is hidden.

Opening and closing it from your code​

Each popup on the page registers itself under its designId:

window.lettrovePopups['01J9ZQ3W8D2K7M5T1V4XG6HB0R'].open();
window.lettrovePopups['01J9ZQ3W8D2K7M5T1V4XG6HB0R'].close();

For a popup set to open only when your code opens it, that is how it opens — from a button, say:

<button onclick="lettrovePopups['01J9ZQ3W8D2K7M5T1V4XG6HB0R'].open()">Get 10% off</button>

Hearing it​

The popup fires a lettrove:popup event on document when it opens and when it closes:

document.addEventListener('lettrove:popup', (event) => {
const { id, action } = event.detail; // id: the designId; action: 'open' | 'close'
analytics.track(`popup ${action}`, { id });
});

What a visitor gets​

  • Keyboard and screen readers: when it opens, focus moves into it and stays inside while it is open; Escape closes it; on close, focus returns to where it was.
  • "How often" is remembered in the visitor's browser. If the browser refuses storage (a private window), the popup simply follows its trigger.

Downloads​

FormatFrom the pageFrom your serverIn the Download menu
HTML (whole, or chunks)exportHtml()designs.export(id, { user })yes
ZIPexportZip()format: 'zip'yes
PNG (the popup drawn open)exportImage()format: 'png'yes

A popup has no PDF.