Skip to content

Timestamp

@astryxdesign/core v0.7.1 · Timestamp

Props ​

NameTypeDefaultDescription
valuestring | number-An ISO instant, or unix seconds. Written to the datetime attribute.
formatTimestampFormat'auto'relative, relative_short, auto, date, date_long, date_weekday, date_time, time, system_date, system_date_time, system_time, or unix_seconds.
autoThresholdnumber604800Seconds before auto switches from a relative phrase to date_time.
hasTooltipbooleantrueShows a hover card with a copyable absolute time. tooltipEntries replaces the default lines.
tooltipEntriesTimestampTooltipEntry[]-Each entry picks a format, an optional timezoneID, and an optional label.
isTimezoneShownbooleanfalseAppends a short zone name to date_time and time.
isLivebooleanfalseRefreshes a relative reading. The interval lengthens as the instant gets older.
typeTextType'supporting'Typography role passed to Text.
sizeTextSize-Optional size override.
colorTextColor | 'disabled''secondary'disabled is painted by this component. The other names are text colors.
weightTextWeight-Optional weight override.

An unknown timezoneID warns in the console and falls back to the local zone.

Theming ​

The visible text uses the text tokens for the chosen color. disabled uses --astryx-color-text-disabled. The hover card is the shared HoverCard.