Skip to content
Date & Time

Countdown

Ticking day/hour/minute/second tiles counting down to a target.

Import

tsx
import { Countdown } from "@cooud-ui/ui";
bash
npx cooud-ui add countdown

Examples

API Reference

Generated from the component's exported types.

CountdownProps

Extends Omit<HTMLAttributes<HTMLDivElement>, "children">

Skip CountdownProps props table
PropTypeDefaultDescription
target*
Date | string | numberThe moment the countdown reaches zero: a `Date`, an ISO-8601 string, or an epoch-ms number. An unparsable target keeps the `--` placeholder and never ticks or completes.
onComplete
() => voidFired exactly once when the countdown reaches zero (immediately after mount when the target is already in the past). Re-arms if `target` later changes to a new future moment.
compact
booleanfalseSmaller tiles + type for tight spots (toolbars, banners, table cells).
labels
Partial<CountdownLabels>Override any subset of the unit captions, e.g. `{ days: "dias" }`.