@sezzle/sezzle-modal
v1.0.0
Published
The Sezzle modal's markup, styles and ModalUI loader, for bundling into a widget at build time
Maintainers
Keywords
Readme
@sezzle/sezzle-modal
The Sezzle modal (pay-in-4 and multi-plan) as an ES module, built from the same
source as the modal in sezzle-widget.js. Bundle it into your widget at build
time instead of fetching sezzle-modal.html and re-executing its script.
import { markup, load } from "@sezzle/sezzle-modal";
// sezzle-widget.js may already have loaded the modal on this page
if (!window.ModalUI) {
modalNode.innerHTML = markup;
window.ModalUI = { load };
}
document.modalLanguage = "en"; // "en" | "es" | "fr"
// optional: document.modalMultiPlan = { pi4InstallmentAmount, pi5InstallmentAmount, ... }
window.ModalUI.load();load() renders into #sezzle-modal-core-content inside markup. It reads
document.modalLanguage and, when set, document.modalMultiPlan,
document.showSezzleNewWidgetModal, document.giveawayConfig and
document.sezzlePromotion.
Built by bun run build (or node scripts/build.mjs package) in
sezzle-js; source in modals/src/.
