Data Display
Countdown
A timer that counts down to a target in day, hour, minute, and second segments. It ticks each second, stops at zero, and fires onComplete. Each segment carries a label so meaning never rests on color.
ReactVueWeb Components
View in Storybook Playground
Examples
<Countdown to={Temporal.PlainDateTime.from('2027-01-01T00:00:00')} onComplete={() => alert('done')} />
<Countdown to="2027-12-31T23:59:59" format="hms" /> Props
| Name | Type | Default | Description |
|---|---|---|---|
to required | Temporal.PlainDateTime | Temporal.ZonedDateTime | string | — | Target date/time. Accepts `Temporal.PlainDateTime`, `Temporal.ZonedDateTime`, or an ISO string. When the target is in the past the display reads all zeros. |
onComplete | () => void | — | Called once when the countdown reaches zero. |
format | CountdownFormat | dhms | Which segments to show. `'dhms'` shows days + hours + minutes + seconds. `'hms'` shows hours (including overflow from days) + minutes + seconds. |
live | boolean | true | Whether to tick each second. |
Accessibility
- Body/background contrast is ≥ 7:1 (AAA) in both light and dark.
- Every interaction works with the keyboard alone.
- The focus ring is always visible.
- Respects prefers-reduced-motion and stops excessive motion.
Every component is designed to meet WCAG 2.1 AAA.