Skip to content
relative-time
AutoXXS (320px)XS (375px)SM (640px)MD (768px)LG (1024px)XL (1280px)XXL (1536px)
SketchMaterialiOSTamagui
DataInjectionKeyPatternsServiceTransactionProcessResearchProductQualityPerformanceSpecDomainFunctionTechnologyArchitectureConfigMiddlewareDataDatabaseDrizzleMigrationModelop-sqliteSchemaSQLState ManagementDraftKeystoneMergePatchPatchesPersistenceReactiveRedoStoreUndoTestingDeviceFactoryIsolationTypeScriptZodTopicsCommunicationBidsNVCDesignDesign ImplicationsEducationPedagogyFoundationsPsychologyAttachmentFloodingRelatingAuthentic RelatingUIEditorReact Native

relative-time

Fragment reference relative-time
tags
ui

Outputs a localized time phrase relative to the current date and time. Localization is handled by the browser’s Intl.RelativeTimeFormat API β€” no language packs required.

Usage

relative-time(date="2026-04-29T10:00:00Z")

Attributes

NameTypeDefaultDescription
datestring | Datenew Date()ISO 8601 date string to calculate from.
formatlong | short | narrowlongDisplay style.
numericauto | alwaysautoauto shows β€œyesterday”; always shows β€œ1 day ago”.
langstringbrowser defaultBCP 47 language tag (e.g. en-US, de, zh-CN).
syncbooleanfalseAuto-updates as time passes.

Dates must be ISO 8601. Avoid ambiguous formats like 03/04/2026 β€” always use YYYY-MM-DDTHH:MM:SSZ.