Xzero UI
Pro library

Time dialPro

Spin a dial to pick an hour and see which team cities are at work.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui-pro/time-dial
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui-pro/time-dial

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { useState } from "react";
import { TimeDial } from "@/components/xzero/time-dial/time-dial";

const cities = [
  { id: "nyc", name: "New York", code: "NYC", offset: -240 },
  { id: "lon", name: "London", code: "LON", offset: 60 },
  { id: "tyo", name: "Tokyo", code: "TYO", offset: 540 },
];

export function CallPlanner() {
  const [time, setTime] = useState(15 * 60);
  return <TimeDial cities={cities} value={time} onValueChange={setTime} hourCycle={24} workingHours={[480, 1020]} label="Call time" />;
}

API reference

TimeDial

A 24 hour rotary dial for choosing a time across time zones. Every city rides the dial at its own local time, a shaded band marks working hours, and the home city reads out in the center.

PropTypeDefaultDescription
cities (required){ id: string; name: string; code: string; offset: number }[]–Two to five cities. offset is minutes from UTC in steps of 15; code is two or three letters shown on the dial.
valuenumber–Controlled time in UTC minutes from midnight on the reference day. May leave 0 to 1439 to reach adjacent days.
defaultValuenumber0Initial time when uncontrolled.
onValueChange(value: number) => void–Fires with the destination as soon as the dial is released or stepped, before it comes to rest.
homeIdstring–Controlled id of the city the dial reads in. Defaults to the first city.
defaultHomeIdstring–Initial home city when uncontrolled.
onHomeChange(id: string) => void–Called when a city is chosen from the list.
minnumber-InfinityEarliest time in UTC minutes. The dial stretches past it and springs back.
maxnumberInfinityLatest time in UTC minutes.
weekdaynumber1Weekday of the reference day in UTC, 0 for Sunday.
hourCycle12 | 2412Clock for the readout: 12 reads 9:30 AM, 24 reads 09:30.
workingHours[start: number, end: number][540, 1080]Local working hours in minutes from midnight, drawn as a band on the dial. A city inside the band is at work. Defaults to 9:00 to 18:00.
labelstring"Time"Accessible name of the dial.
classNamestring–Class on the root element.

Keyboard interactions

KeysAction
Arrow Right / Arrow UpStep forward a quarter hour.
Arrow Left / Arrow DownStep back a quarter hour.
Page Up / Page DownStep an hour forward or back.
Home / EndJump to the start or last quarter hour of the home city's day.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in data

Guidance for AI tools

Time dial: Spin a dial to pick an hour and see which team cities are at work. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components