nuxt-x-affiliate
Exit Intent
Exit-intent popup with email capture and cookie-based dismissal — fires when the reader moves toward closing the tab.
Exit Intent
The XAFExitIntent component renders a centered modal that fires when the reader's mouse leaves the top of the viewport (the "I'm about to close this tab" gesture). Captures emails for your newsletter / deals list and persists dismissal via a cookie so it doesn't pester the same visitor.
Components
<XAFExitIntent />
<XAFExitIntent
title="Don't miss our best deals"
body="Get our weekly roundup of the top picks + exclusive deals, before everyone else."
incentive="🎁 10% off your first purchase when you join"
endpoint="/api/newsletter"
/>
Props
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | "Don't miss our best deals" | Modal heading. |
body | string | long default | Body copy. |
incentive | string | "🎁 10% off your first purchase when you join" | Lead-magnet / incentive line. |
endpoint | string | — | POST { email } here. |
cookieName | string | "xaf_exit_dismissed" | Cookie name for dismissal state. |
cookieDays | number | 30 | Days until dismissal expires. |
showDelay | number | 0 | Delay (ms) between exit-intent and modal appearing. |
Safe to mount globally. Renders nothing when dismissed or before the user moves toward closing.
AI Context
component: XAFExitIntent
package: "@xenterprises/nuxt-x-affiliate"
use-when: Exit-intent popup with email capture and cookie-based dismissal for newsletter / deals opt-in.
