Skip to content
Date & Time

Countdown

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

Import

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

Examples

.cronus

The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.

PortedParity: MatchGeometry 1/1Pixel diff 0 pxLogic 1/1Parity scoreboard
default.cronus
app "audit-fixtures" {
  port 5176
}

style {
  preset aurora
  theme dark
}

component CountdownDefault layout:inline style:countdown {
  aria-label:"Launch"
  label "Launch"
}

page "/audit/countdown/default" type:custom {
  use CountdownDefault
}

API Reference

Generated from the component's exported types.

CountdownLabels

Skip CountdownLabels props table
PropTypeDefaultDescription
days*
string——
hours*
string——
minutes*
string——
seconds*
string——

CountdownProps

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

Skip CountdownProps props table
PropTypeDefaultDescription
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
booleanfalseSmaller tiles + type for tight spots (toolbars, banners, table cells).
labels
Partial<CountdownLabels>—Override any subset of the unit captions, e.g. `{ days: "dias" }`.
className
string—Additional class names merged onto the root.
id
string—DOM id of the root element.