Staaarter

Countdown CTA

A conversion section built around a live-ticking countdown timer, an urgency badge, and a single call-to-action button. Perfect for launches, flash sales, and other time-sensitive promotions.

By Staaarter Team
CTA
Docs
Live preview

Docs

Installation

A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button, badge dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/countdown-cta.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/cta/cta26.tsx instead.

Usage

The file also exports cta26Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.

import { Cta26, cta26Demo } from "@/components/blocks/cta/cta26";

export default function Page() {
  return <Cta26 {...cta26Demo} />;
}

Props

PropTypeDefaultDescription
badgeLabelstring"Limited time offer"Text inside the urgency badge above the heading.
headingstring"The launch discount ends soon"Main heading.
descriptionstring"Lock in 40% off your first year..."Supporting copy under the heading.
targetDatestringnoneISO date string the countdown ticks down to, e.g. "2026-09-01T00:00:00Z". Required.
primaryLabelstring"Claim your discount"Call-to-action button label.
primaryHrefstring"#"Link target for the call-to-action button.
classNamestringnoneExtra classes for the outer section element.

Behavior notes

  • The Days/Hours/Minutes/Seconds tiles are a real, live-ticking countdown: a useState<number | null> holds the milliseconds remaining until the targetDate prop, and a useEffect starts a setInterval(tick, 1000) that recomputes it every second, cleaning up the interval on unmount.
  • The countdown never uses Date.now()/new Date() directly in the render path, only inside the effect's tick function, so server-rendered and card-thumbnail output stay stable until the client hydrates and the timer starts running.
  • The call-to-action button is decorative: it renders as a real Next.js Link via the button's render prop, but defaults to "#" and doesn't perform a real checkout or navigation of its own.