skip to the page
superthread
componentsuse-minute
system
superthread
version
2.15.1
date
24.11.26

use-minute

a hook that returns the clock's minute and the reader's day, for any line that prints how long until or how long since.

bunx --bun shadcn@latest add @mk/use-minute

example

useMinute({ timeZone }) returns now, a Date on the whole minute, and day, like 2026-11-03. it returns null while the page is prerendered, because a server has no reader’s clock. feed now to the time words, and a part minute stays out of them.

light

now
not read yet
day
not read yet

both copies on this page turn over together, on one timer.

dark

now
not read yet
day
not read yet

both copies on this page turn over together, on one timer.

midnight

the timer lands on the clock’s next whole minute, so midnight is an ordinary tick. day changes on that tick, in the reader’s zone. a page that reads its data once keys that read on day, and tomorrow arrives without a reload.

hidden

every caller on a page shares one timer, and the timer stops while the page is hidden. the moment the page shows again it reads the clock, so a laptop opened in the morning prints the morning.