Fine-tune light, shadows, borders, neumorphic
Light and shadows
Borders
Neumorphic
Data

RelativeTime <pm-relative-time>

Relative time ("5 minutes ago", "in 2 days") that keeps itself up to date. Renders a <time> with the full date as a tooltip. format="datetime" shows an absolute, locale-formatted date instead.

Full screen
Updated

Props

<script type="module"> import '@prismora/css'; import '@prismora/elements/relative-time'; </script> <span> Updated <pm-relative-time datetime="2026-01-01T09:00:00Z"></pm-relative-time> </span>

Attributes

AttributeTypeDefaultDescription
datetimestring—ISO date/time.
localestring—BCP 47 locale for formatting (default: the page language).
format'relative' | 'datetime'relativerelative (default) or datetime.
numeric'auto' | 'always'auto"auto" says "yesterday"; "always" says "1 day ago".
date-style
prop: dateStyle
'full' | 'long' | 'medium' | 'short'—How the date is written with format="datetime" (Intl dateStyle, default medium).
time-style
prop: timeStyle
'full' | 'long' | 'medium' | 'short'—How the time is written with format="datetime" (Intl timeStyle; no time when left off).

Also accepts the contextual attributes tone, surface, radius, density, motion, elevation. They are inherited from ancestors' data-* attributes.