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">
| Prop | Type | Default | Description |
|---|---|---|---|
target* | Date | string | number | — | The 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 | () => void | — | Fired 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 | boolean | false | Smaller tiles + type for tight spots (toolbars, banners, table cells). |
labels | Partial<CountdownLabels> | — | Override any subset of the unit captions, e.g. `{ days: "dias" }`. |