shadcn.io is not affiliated with official shadcn/ui
Countdown Segment Stats Block for React
A launch countdown for a product event, with days, hours, minutes and seconds in one band, a pause control, and a registration bar for seats still open.
Installation
Overview
A countdown stat for React with Base UI. A short centred header for Stagewick, a product-launch event, says how many seats are still open ("188 seats open for the keynote"). Under it, a ghost button pauses the clock, and a registration bar shows 4,812 of 5,000 seats taken. The block then ends on a band of four labelled segments, days, hours, minutes and seconds, that come from one timer. The duration is fixed: 11 days, 6 hours and 42 minutes from the moment the page opens. Pausing freezes the time still left; resuming continues it. Two by two on a phone. It's Timer, Progress and Guides.
FAQ
When does the clock start, and when does it stop?
The length is the constant START (11 days, 6 hours and 42 minutes), turned into DURATION_MS, and the catalog timer counts it down from the moment the page opens in the browser. Until it mounts, the cells show the starting digits. It reaches zero only at the target and then stops. There is no calendar date in the file, so the copy never goes stale, and the sentence under the heading is written from the same constant.
What does pausing do?
The button is a timer action trigger: it reads "Pause countdown", then "Resume countdown", and each press pauses or resumes the same timer, so the seconds still left are kept. The label sits over an unseen copy of the longer one, so the button never changes width when it flips. A polite status, empty until the first press, announces "Countdown paused" or "Countdown running". Nothing is saved: a reload starts the clock again.
Why do four cells share one readout?
Days, hours, minutes and seconds are one countdown, not four clocks. The timer area holds a list of four cells, and each cell reads its own part (days, hours, minutes, seconds) from the same timer. The phone uses the same four parts in a two-by-two grid.
How is registration counted?
REGISTERED is 4,812 and CAPACITY is 5,000. Seats still open are the difference, 188, which is the heading and the line beside the bar. The bar's value is the registered share of capacity, rounded: 96%. Edit the two constants and the heading, the line and the bar all change together.
Is the countdown accessible?
Yes. The timer area is named with the whole time left ("11 days, 6 hours, 42 minutes and 0 seconds to the keynote") and is not a live region, so the ticking digits are not announced every second. The cells keep their labels in the text, and the digits are kept in one direction. The pause button announces its change through the polite status.
The bar takes an aria-label.
What moves, and how does it fit on a phone?
The header and the band fade up once, and nothing else is animated: the digits change in place each second, with or without reduced motion. Pausing stops the ticking entirely. The four segments sit in a row from a small screen up, and two by two below that, divided by hairlines that don't add to the row height. Nothing scrolls sideways at 320 pixels. The band ends the block, so there is no rule under it: the next section's top rule closes it.
Related
- Pro
Trend Sparkline Leaderboard Stats
LeaderboardsA podcast chart in a reverse split: eight shows ranked by this week's listeners, each row with a line of its last eight weeks, the value and the change on last week as an arrow and a sign.
- Pro
Quota Tile Grid Stats
Goals and progressSix plan-quota tiles (seats, API calls, storage, projects, bandwidth, builds) with used against limit, a bar, what is left and a reset hint in days; a tile at 90% or more gets a solid bar and an Upgrade link badge.
- Pro
Connected KPI Bar Stats
KPI bands and tilesFour headline figures for a subscription analytics tool in cells that share their hairlines from rail to rail, each with its change on the month before and a tiny sparkline of the last twelve months.
- Pro
Hero Metric Card Stats
Hero metricOne headline figure for a treasury tool, cash on hand in a big number inside a card in a card, with a change pill, a comparison and a two-line footnote that says when it was read and from where.
- 6d 22hPro
Trial Countdown Banner
CountdownsA trial notice for a writing app: a clock, a sentence with the time left ticking, a line on what upgrading keeps, a Shine Button to upgrade and a dismiss button that folds the block away.
- Pro
Digit Countdown Banner
Urgency and limitsA 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.