Component API

<live-timer>

Open live example

Per-second ticking count-up timer, e.g. a live "running for 12s" or
"Sleeping for 3 seconds" indicator. Renders nothing while since is unset
or unparseable.

Install

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

Usage

<live-timer since="2026-07-19T12:00:00Z" prefix="Sleeping for "></live-timer>
<live-timer since="2026-07-19T12:00:00Z" format="compact" prefix="running for "></live-timer>

Attributes / properties

PropertyAttributeTypeDefaultDescription
sincesincestring | nullnullISO-8601 start instant; elapsed time is measured from 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.