Freshness stamp
v0.64.0, changelogBetaHow old a device's last report is, beside the values it qualifies: live, lagging, stale, never reported, or not applicable (air-gapped).
Levels
Install
npx shadcn add @syncrobotic/freshness-stamp Also installs: @syncrobotic/cn, @syncrobotic/use-now, @syncrobotic/relative-time, @syncrobotic/status-glyph, @syncrobotic/tooltip
Overview
When to use
- Beside a device's reported values on its detail page: modules running, GPU, disk.
- In a fleet list's last-seen column, with one
nowfor every row.
Use something else
- Live telemetry that streams (a camera, a chart): their own
staleAfterMs. - Whether the device is online at all: its liveness as an InlineStatus beside its name.
- A failed refresh of data the server holds: Data state stale.
More examples
States and real uses. Each example is also a Storybook story and a visual regression test.
Beside values
Icon and hidden
Clock ahead
Zh tw
Usage rules
- Put it beside every value a device reported, not on the page once: a panel of numbers from a device that stopped yesterday looks exactly like one from a second ago.
- The thresholds are the server's liveness (
laggingAfterMs,staleAfterMs), and itsofflineverdict wins when it sends one. Never a number of the interface's own. - Colour only for lagging (warning) and stale (danger). Never reported and air-gapped are grey: one has not started, the other reports by design.
hideWhenLivewhere a mark on every healthy panel would teach people to stop reading marks;variant="icon"where the age is said once nearby.- Pass one
nowfromuseNowon the page, so a list of stamps changes together.
Changelog
- 0.64.02026-12-01Formatted with Prettier (class order sorted); the code is unchanged.
- 0.56.02026-11-27First release:
freshnessOf(lastAt,(air-gapped before never, the server's verdict before thresholds, a future report is live); the age in words, the exact time in a tooltip and for screen readers; colour only when lagging or stale.thresholds, { now, airGapped, offline })