Component API

<countdown-timer>

Open live example

Per-second ticking count-down timer, e.g. a live "Retrying in 3 seconds"
indicator while waiting to retry a failed request. Renders nothing while
until is unset or unparseable. Remaining time is clamped to zero — it
never goes negative once the target instant has passed.

Install

import "@f-ewald/components/countdown-timer.js";

Usage

<countdown-timer until="2026-07-19T12:00:10Z" prefix="Retrying in "></countdown-timer>
<countdown-timer until="2026-07-19T12:00:10Z" format="compact" prefix="retrying in "></countdown-timer>

Attributes / properties

PropertyAttributeTypeDefaultDescription
untiluntilstring | nullnullISO-8601 target instant; remaining time is measured until here.
formatformatDurationFormat"seconds""seconds" -> "1 second", "12 seconds"; "compact" -> "12s", "3m 12s", "1h 03m 12s".
prefixprefixstring""Text rendered before the formatted value.
suffixsuffixstring""Text rendered after the formatted value.

Events

None.

Slots

None.

CSS custom properties

None.