Installation
Usage
import BannerCountdown from "@/components/ruixen/banner-countdown";
const saleEnd = new Date(Date.now() + 24 * 60 * 60 * 1000);
export default function MyCountdown() {
return (
<BannerCountdown
title="Flash Sale ends in"
endDate={saleEnd}
action={{ label: "Shop now", href: "/sale" }}
onExpire={() => console.log("Sale ended!")}
/>
);
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | - | Text displayed before the countdown |
endDate | Date | - | Target date for the countdown |
action | { label: string; href: string } | - | Action link with arrow |
onExpire | () => void | - | Callback when countdown reaches zero |
onDismiss | () => void | - | Callback fired after dismiss animation |
className | string | - | Additional CSS classes |

