Skip to content
VenusUI
Get started

World Clock

Real analog clocks for several cities with smooth second hands and day and night faces.

Preview

Installation

npx shadcn@latest add @venusui/world-clock

Run this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.

Files added to your project

Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.

  • @/components/ui/world-clock.tsx

Usage

The code behind the preview above.

world-clock-demo.tsx

import { WorldClock } from "@/components/ui/world-clock"

export default function WorldClockDemo() {
  return (
    <WorldClock
      zones={[
        { city: "San Francisco", timeZone: "America/Los_Angeles" },
        { city: "London", timeZone: "Europe/London" },
        { city: "Bengaluru", timeZone: "Asia/Kolkata" },
        { city: "Tokyo", timeZone: "Asia/Tokyo" },
      ]}
    />
  )
}

API reference

PropTypeDefaultDescription
zones{ city: string; timeZone: string }[]—Cities and their IANA time zones, e.g. Asia/Tokyo.

All <ul> props.

Requirements

  • React 19 and Tailwind CSS v4. Uses Intl.DateTimeFormat; no time-zone library needed.

Customization

  • Faces turn dark between 19:00 and 06:00 in that city. Change the hours in night in the file.

Accessibility

  • Each clock is a list item with the city, the digital time and the offset as text; the dial is decorative.
  • One shared animation-frame loop moves the hands without re-rendering; with reduced motion the second hand ticks once a second.

Troubleshooting

Hands appear a moment after the page loads.
That's deliberate: the server doesn't know the visitor's time, so hands are drawn in the browser to avoid a wrong flash.
Unknown registry "@venusui"
Your shadcn CLI couldn’t find the namespace in the shadcn registry index. Use the latest CLI (npx shadcn@latest), install by URL, or register it with its address: npx shadcn@latest registry add @venusui=https://venusui.com/r/{name}.json.
No components.json found
Run npx shadcn@latest init in your project first.
Loading preview

Analog Clock

Data display

A station clock whose needle waits at twelve; drag the minute hand to set it by hand.

Loading preview

Avatar Stack

Data display

Overlapping avatars with a +N counter that spread apart on hover.

Loading preview

Bookshelf

Interactive

Books on a wooden shelf whose spines lift on hover and pull out when selected, with a matching cover.