daltonmenezes / use-exit-intent

🐠 A React Hook to handle exit intent strategies

Home Page:https://use-exit-intent.daltonmenezes.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

preview

useExitIntent: 🐠 A React Hook to handle exit intent strategies

github url patreon url releases url license url

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.

🐠 Features

  • 🚀 Multiple handlers can be registred
  • 🔥 Highly configurable
  • 🧠 Different strategies for Desktop and Mobile
  • ⛔️ Unsubscription support with cookies
  • 🎉 Built with TypeScript

🐠 Installation

In your terminal, run:

  • npm
    npm i use-exit-intent
  • pnpm
    pnpm i use-exit-intent
  • yarn
    yarn add use-exit-intent

🐠 Usage

In your React component:

import { useExitIntent } from 'use-exit-intent'

export function App() {
  const { registerHandler } = useExitIntent()

  registerHandler({
    id: 'openModal',
    handler: () => console.log('Hello from handler!')
  })

  // ...
}

🐠 Knowledge

🐠 Contributing

Note: contributions are always welcome, but always ask first, — please — before work on a PR.

That said, there's a bunch of ways you can contribute to this project, like by:

  • 🪲 Reporting a bug
  • 📄 Improving this documentation
  • 🚨 Sharing this project and recommending it to your friends
  • 💵 Supporting this project on GitHub Sponsors or Patreon
  • 🌟 Giving a star on this repository

License

MIT © Dalton Menezes

About

🐠 A React Hook to handle exit intent strategies

https://use-exit-intent.daltonmenezes.com

License:MIT License


Languages

Language:TypeScript 91.9%Language:MDX 6.1%Language:JavaScript 1.9%Language:Shell 0.1%