Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/daltonmenezes/use-exit-intent
🐠 A React Hook to handle exit intent strategies
https://github.com/daltonmenezes/use-exit-intent
exit-intent hook library nextjs react typescript
Last synced: 12 days ago
JSON representation
🐠 A React Hook to handle exit intent strategies
- Host: GitHub
- URL: https://github.com/daltonmenezes/use-exit-intent
- Owner: daltonmenezes
- License: mit
- Created: 2022-10-07T04:24:45.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-24T01:23:49.000Z (8 months ago)
- Last Synced: 2024-05-02T04:30:29.020Z (6 months ago)
- Topics: exit-intent, hook, library, nextjs, react, typescript
- Language: TypeScript
- Homepage: https://use-exit-intent.daltonmenezes.com
- Size: 1.29 MB
- Stars: 73
- Watchers: 3
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
useExitIntent: 🐠 A React Hook to handle exit intent strategies> 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
```bash
npm i use-exit-intent
```
- pnpm
```bash
pnpm i use-exit-intent
```
- yarn
```bash
yarn add use-exit-intent
```# 🐠 Usage
In your React component:
```tsx
import { useExitIntent } from 'use-exit-intent'export function App() {
const { registerHandler } = useExitIntent()registerHandler({
id: 'openModal',
handler: () => console.log('Hello from handler!')
})// ...
}
```# 🐠 Knowledge
- [Docs](https://use-exit-intent.daltonmenezes.com/docs/getting-started/overview)
- [Playground](https://use-exit-intent.daltonmenezes.com/#playground)# 🐠 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:
- :beetle: Reporting a bug
- :page_facing_up: Improving this documentation
- :rotating_light: Sharing this project and recommending it to your friends
- :dollar: Supporting this project on GitHub Sponsors or Patreon
- :star2: Giving a star on this repository# License
[MIT © Dalton Menezes](https://github.com/daltonmenezes/use-exit-intent/blob/main/LICENSE)