169
A local-time page for any city: a live clock whose digits roll, the sun on today's arc, your working hours against theirs with the best time to meet, and the year's clock changes, all re-computed as you switch cities.
akaworld clock·time zone·local time
Run this in any project set up for the shadcn CLI. It copies the City Time source into your components folder, so the code is yours to change.
npx shadcn@latest add https://devl.dev/r/city-time.jsonImport it and render it. Every prop has a typed default, so it works straight away, and you pass your own data when you’re ready.
import { CityTime } from "@/components/city-time";
export default function Page() {
return <CityTime />;
}A free React block in the Apps collection, written in TypeScript with Tailwind CSS on coss ui. MIT licensed.
Read from the City Time source. Everything is optional unless it says required.
| Prop | Type | Default |
|---|---|---|
| cities | City[] | defaultCities |
| defaultCity | string | — |
| workingHours | { start: number; end: number } | { start: 9, end: 17 } |
| defaultHourCycle | HourCycle | "24h" |
| locale | string | "en-GB" |
| className | string | — |