Xzero UI
Pro library

Time picker

Choose a time with sensible keyboard behavior.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui/time-picker
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/time-picker

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 { TimePicker } from "@/components/xzero/time-picker/time-picker";

export function MeetingTime() {
  const [time, setTime] = useState("14:30");
  return <TimePicker label="Start time" value={time} onChange={setTime} minuteStep={30} />;
}

API reference

TimePicker

A trigger with a scrolling listbox of times at a fixed minute step; the shown time rolls like a clock.

PropTypeDefaultDescription
label (required)string–Visible label.
valuestring–Controlled time as "HH:mm" (24-hour).
defaultValuestring"09:00"Initial time when uncontrolled.
onChange(value: string) => void–Called with the new "HH:mm" value.
descriptionstring–Helper copy under the field.
placeholderstring"Select a time"Shown when the value is empty.
minuteStep1 | 5 | 10 | 15 | 3015Spacing between options.
format"12h" | "24h""12h"Display format. Values stay 24-hour.
disabledbooleanfalseDisables the trigger.
classNamestring–Added to the root.

Keyboard interactions

KeysAction
Enter / SpaceOpens the list, or selects the active time when open.
ArrowDown / ArrowUpOpens the list, then moves through times, wrapping.
EscapeCloses the list.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in pickers

Guidance for AI tools

Time picker: Choose a time with sensible keyboard behavior. 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