Docs/Banner

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

PropTypeDescriptionDefault
idstringUnique key for persistence tracking—
openbooleanControls visibilityfalse
onOpenChange(open: boolean) => voidCallback when open state changes—
position"top" | "bottom" | "left" | "right"Banner placement"bottom"
animation"fade" | "slide" | "bounce"Animation style"slide"

Countdown Timer — from Bottom

A dark navy bottom banner with a live countdown clock, bold sale headline, and a cyan CTA. Creates urgency without interrupting browsing.

Info Panel — from Bottom

A clean white bottom banner with an icon, headline, body copy, and two action buttons. Shown after a timer trigger — ideal for feature announcements.

Cookie Consent — from Bottom

A dark consent bar with cookie policy text and two distinct action buttons: Accept All and Use Necessary Only. GDPR-ready pattern.

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...