Countdown
Launch timers in split-flap, digital or neon-tube digits.
Installation
npx shadcn@latest add https://neonkit.heyaadi.com/r/countdown.jsonUsage
import { Countdown } from "@/components/ui/countdown"
<Countdown to="2026-12-31T23:59:59Z" onComplete={() => setLaunched(true)} />Examples
Digital
Seven-segment digits with unlit segments showing. Without days in units, hours carry the overflow.
Neon sign
Bent-tube numerals. They sit as unlit glass until the first tick, then light up.
On complete
onComplete fires once when the timer hits zero. Change the key to start a fresh run.
API reference
Renders a <div role="timer">. Digits appear after mount, so server and browser HTML match.
| Prop | Type | Default |
|---|---|---|
to | DateThe moment it reaches zero: a Date, an ISO string or epoch milliseconds. | None |
variant | "flip"Split-flap cards, seven-segment digits, or neon tube numerals. | "flip" |
units | ("days" | "hours" | "minutes" | "seconds")[]Which units to show. The largest one absorbs the rest, so without days 50 hours stays 50. | all four |
labels | booleanCaptions under each unit. false hides them; an object renames them, which also changes what screen readers hear. | true |
onComplete | () => voidCalled once at zero, or straight after mount if | None |
size | "sm"Digit height: 40, 56 or 80px. Override with a [--countdown-h:72px] class for responsive sizes. | "md" |
color | NeonColorPalette name or hex. Falls back to --neon-accent, then cyan. | inherited |
Accessibility
- role="timer" isn't a live region, so screen readers aren't interrupted every second. Visually hidden text such as "2 days, 14 hours, 7 minutes, 33 seconds" is there when they read it.
- Give the timer an accessible name with aria-label, e.g. "Time until the launch window opens".
- The timer wakes just after each whole second and recomputes from the clock, so it never drifts or skips.
- With reduced motion, flips and tube strikes are skipped and digits change in place.