Command Palette

Search for a command to run...

Docs
Banner Countdown

Banner Countdown

A countdown timer banner for sales, launches, and time-sensitive promotions.

Installation

Usage

import BannerCountdown from "@/components/ruixen/banner-countdown";
 
// Sale ends in 24 hours
const saleEndDate = new Date(Date.now() + 24 * 60 * 60 * 1000);
 
export default function MyCountdownBanner() {
  return (
    <BannerCountdown
      variant="urgent"
      title="Flash Sale ends in"
      endDate={saleEndDate}
      ctaLabel="Shop now"
      ctaHref="/sale"
      onExpire={() => console.log("Sale ended!")}
    />
  );
}

Props

PropTypeDefaultDescription
titlestring-Text displayed before countdown
endDateDate-When the countdown ends
ctaLabelstring"Shop now"Call-to-action button text
ctaHrefstring"#"Call-to-action link URL
variant"default" | "urgent" | "celebration""default"Visual style of the banner
showDaysbooleantrueWhether to show days counter
dismissiblebooleantrueWhether banner can be dismissed
onExpire() => void-Callback when countdown ends
onCtaClick() => void-Callback when CTA clicked
onDismiss() => void-Callback when dismissed
classNamestring-Additional CSS classes

Variants

VariantDescription
defaultPrimary background color
urgentRed gradient with pulsing animation
celebrationPurple to fuchsia gradient for launches