DS0
Components

CountdownTimer

A countdown timer that displays remaining time in days, hours, minutes, and seconds.

Overview

CountdownTimer counts down to a target date/time, displaying segmented units (days, hours, minutes, seconds) with automatic updates every second.

Usage

<CountdownTimer
  targetDate={new Date('2025-01-01T00:00:00')}
  onComplete={() => console.log('Happy New Year!')}
/>

API Reference

PropTypeDefaultDescription
targetDateDateTarget date to count down to
onComplete() => voidCallback when countdown reaches zero
showDaysbooleantrueShow days segment
showSecondsbooleantrueShow seconds segment
variant'default' | 'compact''default'Display style

Accessibility

  • Uses aria-live="polite" for screen reader updates
  • Each segment has aria-label describing the unit
ComponentWhen to Use Instead
ProgressProgress toward a goal
StatCardStatic numeric display

On this page