Concepts
Three surfaces, one visibility model, five ways to decide when to show them.
Components
Pick a surface based on how much attention the message deserves:
| Component | Description |
|---|---|
| Popout | Centered modal with a backdrop overlay. Best for high-intent asks — newsletter signups, flash sales — that should interrupt the page briefly. |
| SlideIn | Fixed panel anchored to the left or right edge. Lower-friction than a modal — good for discount codes and secondary offers that shouldn't block the page. |
| Banner | Full-width bar anchored to the top or bottom of the viewport. Best for announcements, cookie consent, and countdown timers that stay visible while browsing. |
The trigger model
None of the three components decide when to appear on their own — that's deliberate. Instead, a trigger hook (useTimerTrigger, useScrollTrigger, useExitTrigger, or useInactivityTrigger) watches for a condition and calls the same onOpenChange setter you'd call by hand. This keeps the trigger logic and the presentation completely decoupled — swap a timer for an exit-intent trigger without touching the component markup.
Persistence
useTriggerPersistence reads and writes a localStorage record keyed by the popup's id, so a visitor who already dismissed (or converted on) a popup doesn't see it again on their next visit. See usePersistence for the full API.