shadcn.io is not affiliated with official shadcn/ui
Countdown Offer Pricing Block for React
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.
Installation
Overview
Drive conversions with honest urgency using this countdown offer pricing section. The clock is the hero: a live Timer counts down to the end of the month in days, hours, minutes and seconds, set at display size (72 px on a wide screen) in the header row, beside a headline and one sentence that say what ends: "Producer is 42% off". Below it, three plans for a music-production app (Lite, Producer and Label) stand in cells whose rails overshoot their corners, with + marks on the crossings. Producer is tinted and badged, its regular $19 struck through beside the $11 launch price with the saving written out, and its Shine Button is the block's one primary button; the others are outlined. On a phone a Segment Group shows one plan at a time, Producer first, while the countdown stays on top. Built with Timer, Segment Group, Badge, Shine Button, Guides and Lucide icons, with CSS transitions only. For launches, early-access rates and any offer with a real deadline.
FAQ
How do I change the plans, the prices and the deadline?
Edit the data at the top of the file. Each entry in PLANS has its name, description, price, features, call to action text and href, and one plan has offer: true with an originalPrice: the struck price, the badge's percentage and the "$8 off" line are all worked out from the two prices. The deadline is endOfMonth, a function that returns a Date; return your own date, such as the end of a launch week, and the clock follows.
What happens when the clock reaches zero?
The timer stops at zero and nothing else changes: the block doesn't remove the offer for you. Treat the clock as a display of a deadline you enforce on your server: stop applying the launch price at checkout at that moment, and render the plans without originalPrice (or remove the section) once it has passed. Never rely on the visitor's clock for the price itself.
Why doesn't the countdown show on the server?
The deadline is read from the visitor's own clock, so the server can't know it. The timer holds a placeholder, hidden, until the browser has the time and then starts, so the server's markup and the first client render always agree.
How do I connect the buttons to checkout?
Each call to action is a real link to its plan's href. It's a ShineButton with render set to an a element and nativeButton={false}. Point the offer's link at a checkout that applies the launch price, a coupon or a separate discounted price at your payment provider, and expire it on your server at the deadline.
Is the countdown accessible, and does it respect reduced motion?
The timer has the timer role, which isn't announced as it changes, so a screen reader doesn't read out every second; it's named by the "Launch price ends in" line, and each unit has its full word ("days", "hours") for screen readers. Under reduced motion the seconds column is removed and the clock changes once a minute, and the entrance animations are switched off. On a phone the plan selector is a radio group named "Plan": the arrow keys change the plan, and the plans that aren't shown are invisible to assistive technology and to Tab.
How does it look on a phone?
The header stacks: headline, sentence, then the countdown, all within the first screen. Below md the Segment Group picks one plan and the other two are hidden with visibility, but all three share one grid cell, so the block keeps the height of the tallest plan and nothing jumps when you switch. From md the three plans sit side by side and share their rows through CSS subgrid, so names, prices, buttons and feature lists line up.
Related
- %Pro
Seasonal Sale Pricing
Discounts and offersA seasonal sale for a stock-photo library: an oversized '−41%' stamp in the header row under an 'Autumn sale' ribbon, over three plans in shared-hairline cells with struck prices and the sale price at display size.
- Pro
Early Bird Pricing
Discounts and offersFounder seats that run out: '163 of 200 claimed' at display size over a bar of forty segments, with the one founder plan, its struck regular price and its lifetime price beside the features.
- Pro
Annual Savings Pricing
Billing switchesThree plans that show what yearly billing saves: each plan's head holds two bars, twelve monthly payments against one yearly payment, with the saving printed in the gap, under a monthly and yearly switch.
- Pro
Contrast Highlight Pricing
Plan cardsThree plans for a cloud IDE in one hairline band, with a contrast highlight that follows the theme: the recommended plan is one raised card among flat cells, with a free tier, prices that roll under a monthly and yearly switch, and a plan switch on phones.
- %Pro
Committed Spend Discount Pricing
Billing switchesFour big commitment chips, $500 to $50k a month, and in the same row the discount each earns at display size, over every unit's committed price against its on-demand price, with the call to action beside the result.
- Pro
Three Columns Pricing
Plan cardsThe canonical three-column pricing section for a team knowledge base: Personal, Team and Company cells under a monthly and yearly switch, each outlined by hairlines that overshoot its corners, the recommended plan raised, one plan at a time on phones.