Modales & Capasconversionmodaloverlay
Exit Intent Popup
Modal inteligente que se activa al detectar intención de salida del usuario de la página.
Vista Previa en Vivo
Wait! Before you go...
Get 20% off your first order when you join our mailing list.
Uso
Copia y pega este código directamente en tu componente React:
tsx
import { ExitIntentOverlay } from 'react-component-kit-ui/overlays';
<ExitIntentOverlay>Content</ExitIntentOverlay>Instalación Manual
Si no estás usando el paquete npm, crea un archivo nuevo y pega el siguiente código: src/components/ExitIntentOverlay.tsx + ExitIntentOverlay.css:
ExitIntentOverlay.tsx
'use client';
import './ExitIntentOverlay.css';
/** ExitIntentOverlay — ported from astro-component-kit. */
export interface ExitIntentOverlayProps {
}
export function ExitIntentOverlay({}: ExitIntentOverlayProps) {
return (
<>
<div className="exit-modal" data-rk-aa5def="">
<div className="exit-card" data-rk-aa5def="">
<h2 data-rk-aa5def="">Wait! Before you go...</h2>
<p data-rk-aa5def="">Get 20% off your first order when you join our mailing list.</p>
<input type="email" placeholder="Your email" data-rk-aa5def="" />
<button data-rk-aa5def="">Get My Code</button>
</div>
</div>
</>
);
}
export default ExitIntentOverlay;ExitIntentOverlay.css
/* ExitIntentOverlay — ported from astro-component-kit (overlays/ExitIntentOverlay.astro) */
.exit-modal:where([data-rk-aa5def]) { position: fixed; inset: 0; background: rgba(99,102,241,0.1); backdrop-filter: blur(15px); z-index: 6000; display: grid; place-items: center; }
.exit-card:where([data-rk-aa5def]) { background: #fff; color: #000; padding: 3rem; border-radius: 30px; text-align: center; max-width: 450px; box-shadow: 0 20px 60px rgba(0,0,0,0.1); }
h2:where([data-rk-aa5def]) { font-weight: 900; font-size: 1.8rem; margin-bottom: 1rem; }
p:where([data-rk-aa5def]) { color: #64748b; margin-bottom: 2rem; line-height: 1.5; }
input:where([data-rk-aa5def]) { width: 100%; padding: 1rem; border: 1px solid #eee; border-radius: 12px; margin-bottom: 1rem; outline: none; font-size: 1rem; }
button:where([data-rk-aa5def]) { width: 100%; padding: 1rem; background: #6366f1; color: #fff; border: none; border-radius: 12px; font-weight: 800; cursor: pointer; transition: 0.2s; }
button:hover:where([data-rk-aa5def]) { background: #4f46e5; }Información Rápida
- Categoría
- Modales & Capas
- Nombre de archivo
ExitIntentOverlay.tsx- Dependencias
- Ninguna — React + CSS puro
- Etiquetas
- conversionmodaloverlay