Feedback
Count Down
A real-time countdown timer with configurable target date, size variants, and expiration callback.
00
Days:
00
Hrs:
00
Min:
00
SecSizes
Three size variants for different contexts.
sm
00
Days:
00
Hrs:
00
Min:
00
Secmd
00
Days:
00
Hrs:
00
Min:
00
Seclg
00
Days:
00
Hrs:
00
Min:
00
SecWithout Labels
A compact variant that hides unit labels.
00
:
00
:
00
:
00
Props
| Prop | Type | Default |
|---|---|---|
targetDate | Date | string | number | — |
size | "sm" | "md" | "lg" | "md" |
showLabels | boolean | true |
onEnd | () => void | — |
className | string | — |
Usage
import { CountDown } from '@/components/ui/count-down';
// Set a target 24 hours from now
const target = new Date();
target.setHours(target.getHours() + 24);
// Default
<CountDown targetDate={target} />
// Large, no labels
<CountDown targetDate={target} size="lg" showLabels={false} />