Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Digit Countdown Banner Block for React

A slim early-pricing band between the page rails, in your theme: the offer at the start, then past a solid divider a live countdown to the end of this month in a small frame beside a Shine Button, with a hairline along the bottom edge that drains as the month runs out.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Put a clock in a band with this compact call to action for React with Base UI. Between the page rails, the offer sits at the start ("Early pricing ends this month", a sentence with a bold lead), and past a solid divider that meets the top rule a live countdown to the end of the month shows days, hours, minutes and seconds, whose digits drop into place as they change (Countdown Text), in a small frame of hairlines with + marks on its corners, beside a Shine Button "Claim early price". Along the band's bottom edge a thin foreground-coloured line shows how much of the month is left. Below lg the two parts stack with a rule between them. It's built from Countdown Text, Shine Button and Guides, with CSS only for the line and your theme's tokens for every colour, so the band follows your theme, light or dark. For early pricing, monthly promotions and any offer that closes when the month does.

FAQ

What is it counting down to, and can I change it?

The first moment of next month in the visitor's own time zone, worked out in the browser: monthEnd() at the top of the file. The server can't know the time, so until the page is running the digits are hidden and the space is reserved, so nothing shifts when they appear. When the countdown reaches zero it moves to the end of the next month by itself. For a fixed deadline, return your own Date from monthEnd() and the hairline's start from leftOf().

How does the hairline drain?

Its width is the share of the month still ahead, from the first of the month to the end. It starts full, drops to the real share once the page knows the time, and is updated every thirty seconds (DRAIN_EVERY_MS) with a CSS width transition; that's slow because a month has forty thousand minutes, so the line shifts by a pixel only every few hours. It is decoration and hidden from screen readers; the countdown carries the information.

What does a screen reader hear for the digits?

The visible digits are hidden from assistive technology, and a visually hidden sentence in full words ("19 days, 7 hours, 50 minutes, 17 seconds") takes their place inside a time element. It is not a live region, so a screen reader doesn't read every second out; it reads the current time when the reader reaches it.

Can I change how the countdown is written?

Yes: Countdown Text takes a format (narrow is the default, "19d 07h 50m 17s"; short and long use words; digital writes 19:07:50:17) and a locale, which also sets the digits and unit names. Days and hours drop out when they reach zero, so the last hour reads 59m 59s.

Where does the button go?

Claim early price is a real link (href="#"): point it at your offer or checkout. It is a ShineButton with render set to an a element and nativeButton={false}.

What moves, and what happens with reduced motion?

Only a digit that changes moves: it drops into its one-digit window as the old one falls away. With reduced motion the digits change in place and the hairline jumps to its new length. On a narrow screen the band stacks: the copy, then a rule, then the countdown and the button.

  • Pro

    Ribbon Urgency CTA

    Urgency and limits

    A reverse split sale call to action: the discount at display size under a corner sash reading Limited time, a hairline divider, then an Ends in 3 days badge, the headline and a Shine Button. Urgency comes from type and structure, not a red fill.

  • Pro

    Progress Urgency CTA

    Urgency and limits

    A centred scarcity statement: a headline over a framed seat map of 200 dots, one per founding seat, with the claimed ones solid and the next open ones pulsing, then the price with its list price struck and a Shine Button.

  • Pro

    Metadata Tagline CTA

    Prices and offers

    An event call to action as a band: the name and pitch, the struck standard price beside the early-bird price and a Shine Button, over a closing masthead band of three facts.

  • Pro

    A slim upsell band between the page rails: a headline and a sentence with the Shine Button to the Pro plans, and a closing band of three locked features on shared hairlines.

  • Pro

    A compact centred launch hero on solid rails with a live countdown as a full-width band of four cells and an email form whose Shine Button shows its loading and success states.

  • Pro

    Countdown Offer Pricing

    Discounts and offers

    A launch price on a clock: a live countdown in days, hours, minutes and seconds at display size beside the headline, over three plans for a music app, one of them discounted. A Segment Group shows one plan at a time on a phone.