Banner
Full-width horizontal banners anchored to the top or bottom of the viewport. Great for time-sensitive alerts, announcements, and consent notices.
$import { Banner } from react-marketing-popups
Props
| Prop | Type | Description | Default |
|---|---|---|---|
| id | string | Unique key for persistence tracking | — |
| open | boolean | Controls visibility | false |
| onOpenChange | (open: boolean) => void | Callback when open state changes | — |
| position | "top" | "bottom" | "left" | "right" | Banner placement | "bottom" |
| animation | "fade" | "slide" | "bounce" | Animation style | "slide" |
Code Examples
By design the open state is handled outside of the component
Core Banner
Use Banner directly — manage open state with useState and wire it to onOpenChange.
Loading...Trigger hooks
Use hooks for automatic triggering. Pass onOpenChange to wire the hook to your open state. Each hook also returns [fired, setFired] if you need to track whether it has fired.
Loading...