ki-relative-time
@kimen/elements/ki-relative-time- Source
- Agent reference
Pass an ISO timestamp. numeric="auto" can display words like “yesterday”.
Set numeric="always" to use numeric wording. Add sync to refresh the text
as time passes, and set threshold in seconds to switch to an absolute
timestamp when the distance reaches the cutoff.
<ki-relative-time date="2026-11-19T08:41:00Z" sync threshold="86400"></ki-relative-time>The result uses native time semantics. Its absolute timestamp is available
to assistive technology and in the tooltip. The visible wording changes
without a live announcement.
API reference
When to use: For timestamps whose distance from the present matters, such as timeline entries or recent changes.
When not to use: For an interactive countdown or a date that should always show an absolute value.
Properties & attributes
| Attribute | Property | Type | Default | Description |
|---|---|---|---|---|
date | date | string | undefined | – | ISO calendar date or date-time. A timestamp without an offset uses local time. |
numeric | numeric | "always" | "auto" | 'auto' | Auto can show words such as yesterday. Always uses a number. |
sync | sync | boolean | false | Refresh the visible wording as the clock crosses a formatting boundary. |
threshold | threshold | number | undefined | – | Display an absolute timestamp when the distance reaches this many seconds. Omit to keep relative wording at any distance. |
CSS custom properties
The public styling contract of ki-relative-time: reassign these tokens at :root or on a subtree — never override internals.
| Token | Description |
|---|---|
--ki-relative-time-font-family | Default body font family for ki-relative-time on a bare page. |