The Exit Intent strategy is a great way to increase your conversion rate. That strategy is commonly used to show a modal/popup when the user is about to leave your website.
useExitIntent hook is simple to use and you can customize it to your needs. Here are the main features:
- 🚀 Multiple handlers can be registred
- 🔥 Highly configurable
- 🧠 Different strategies for Desktop and Mobile
- ⛔️ Unsubscription support with cookies
- 🎉 Built with TypeScript
Installation
yarn
yarn add use-exit-intent
npm
npm i use-exit-intent
Importing
import { useExitIntent } from 'use-exit-intent'
Using
In your React component:
export function App() {
const { registerHandler } = useExitIntent()
registerHandler({
id: 'openModal',
handler: () => console.log('Hello from handler!')
})
// ...
}
To get more knowledge about this hook:
Top comments (1)
interesting feature, I decided to use it. The only thing that creates inconvenience in use is that if the client accidentally points to the exit, a modal window immediately opens, even though he set the value in seconds.
overall a cool package and quick to use