BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/atroui/exit-intent-popup

Exit Intent Popup

atroui/exit-intent-popup
FreeBlock

Exit-intent dialog with editable CONTENT and storage keys.

Install it

npx shadcn@latest add https://atroui.com/r/exit-intent-popup.json

Source

registry/default/blocks/exit-intent-popup.tsxatroui.com/r/exit-intent-popup.json
1"use client"
2
3import { X } from "lucide-react"
4import Link from "next/link"
5import { useCallback, useEffect, useRef, useState } from "react"
6
7/**
8 * Edit CONTENT to change exit-intent copy and storage keys.
9 */
10const CONTENT = {
11 stamp: "Before you go",
12 title: "Free 7-day MVP scoping",
13 body: "Not sure what to build first? Book a no-pressure scoping call - we'll map scope, timeline, and budget in one session.",
14 primaryLabel: "Start free scoping",
15 primaryHref: "/scope",
16 secondaryLabel: "Maybe later",
17 storageKey: "atroui_exit_intent_v1",
18 sessionKey: "atroui_exit_intent_session",
19}
20
21function shouldShowPopup(): boolean {
22 if (typeof window === "undefined") return false
23 if (localStorage.getItem(CONTENT.storageKey)) return false
24 if (sessionStorage.getItem(CONTENT.sessionKey)) return false
25 return true
26}
27
28function markShown() {
29 sessionStorage.setItem(CONTENT.sessionKey, "1")
30}
31
32function markDismissed() {
33 localStorage.setItem(CONTENT.storageKey, "dismissed")
34 sessionStorage.setItem(CONTENT.sessionKey, "1")
35}
36
37export type ExitIntentPopupProps = {
38 /** Docs / demos: open immediately and render inline. */
39 preview?: boolean
40}
41
42export function ExitIntentPopup({ preview = false }: ExitIntentPopupProps) {
43 const [open, setOpen] = useState(preview)
44 const dialogRef = useRef<HTMLDivElement>(null)
45 const triggered = useRef(false)
46
47 const close = useCallback(() => {
48 setOpen(false)
49 if (!preview) markDismissed()
50 }, [preview])
51
52 useEffect(() => {
53 if (preview) return
54 if (!shouldShowPopup()) return
55
56 const onMouseLeave = (e: MouseEvent) => {
57 if (triggered.current) return
58 if (e.clientY > 12) return
59 if (!shouldShowPopup()) return
60 triggered.current = true
61 markShown()
62 setOpen(true)
63 }
64
65 document.documentElement.addEventListener("mouseleave", onMouseLeave)
66 return () =>
67 document.documentElement.removeEventListener("mouseleave", onMouseLeave)
68 }, [preview])
69
70 useEffect(() => {
71 if (!open || preview) return
72
73 const onKeyDown = (e: KeyboardEvent) => {
74 if (e.key === "Escape") close()
75 }
76
77 document.addEventListener("keydown", onKeyDown)
78 dialogRef.current?.focus()
79
80 const focusable = dialogRef.current?.querySelectorAll<HTMLElement>(
81 'a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"])',
82 )
83 const first = focusable?.[0]
84 const last = focusable?.[focusable.length - 1]
85
86 const trapFocus = (e: KeyboardEvent) => {
87// … truncated

What it pulls in

npm packages

  • lucide-react
  • next

Files it writes

  • registry/default/blocks/exit-intent-popup.tsx

Facts

Registry
atroui
Type
registry:block
Access
Free
Files written
1
Licence
MIT
In the index
at or before 2026-08-13
Last confirmed
today

Go to the source

atroui.com atroui/atroui on GitHub Raw registry item This item as JSON

More from atroui

All 82 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Analytics Provideranalytics-provideratrouiBlocksFree1 dep
AR Portfolioar-portfolioatrouiBlocksFree1 dep
Before / Afterbefore-after-slideratrouiBlocksFreeno deps
Calendly Embedcalendly-embedatrouiBlocksFree1 dep
ChangelogchangelogatrouiBlocksFreeno deps
Command Menucommand-menuatrouiBlocksFree4 deps
Contact Formcontact-formatrouiBlocksFree2 deps
Contextual CTAcontextual-ctaatrouiBlocksFree2 deps

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex