# Timezone picker

Search consumer-supplied IANA time zones with offsets calculated for an explicit reference instant.

Access: pro. Category: Forms. Kind: primitive.

## When to use

- Use it when a product interface needs search consumer-supplied iana time zones with offsets calculated for an explicit reference instant.
- Choose it when the host application can supply the required state and keep business logic outside the presentation component.

## Alternatives

- Choose form-field instead when a labeled email field with validation and help text is the actual interface need, rather than timezone picker.

## Setup for agents

Use React 19 and TypeScript. Initialize shadcn for your framework, then merge this exact entry into components.json:

```json
{
  "registries": {
    "@tidal-pro": {
      "url": "https://tidalui.com/r/pro/{name}.json",
      "headers": {
        "Authorization": "Bearer ${TIDALUI_TOKEN}"
      }
    }
  }
}
```

The namespace must be named **@tidal-pro** because transitive Pro dependencies use that namespace. Obtain an agent key from your active Pro account at https://tidalui.com/account. Keep TIDALUI_TOKEN in your local environment, never in components.json, client code, Git or logs.

```sh
export TIDALUI_TOKEN='your-private-agent-key'
npx shadcn@latest add @tidal-pro/waitlist-form
npx shadcn@latest add https://tidalui.com/r/tidal-button.json
```

Free command: `npx shadcn@latest add https://tidalui.com/r/<name>.json`.
Pro command: `npx shadcn@latest add @tidal-pro/<name>`.

Import the base stylesheet and every stylesheet listed on the installed item's metadata. For example:

```tsx
import "./components/ui/tidal.css";
import "./components/ui/hero-section.css";
// Place installed components inside this wrapper:
<div className="tidal-scope" data-theme="dark">...</div>
```

Omit data-theme for the default light theme. Put the attribute on the same tidal-scope element for dark mode. Every component installs the shared free tidal-base dependency. After upgrading, run `npx shadcn@latest add https://tidalui.com/r/tidal-base.json --overwrite` to receive current tokens. Review local modifications before overwriting.

Vite: Use React + TypeScript. Map @/* to ./src/* in paths and Vite resolve.alias. Import tidal.css and each component stylesheet in your application entry.

Next.js 15 App Router: Next.js App Router: import tidal.css and component CSS in app/layout.tsx. Interactive examples belong in a client component with "use client". Map @/* to ./* or ./src/* to match your project.

TypeScript 6: use paths without baseUrl:

```json
{
  "compilerOptions": {
    "paths": {
      "@/*": [
        "./src/*"
      ]
    }
  }
}
```

Pro registry requests are server/CLI-only. Use the same-origin account interface in a browser; cross-origin Authorization preflights are intentionally unsupported.


## Install Timezone picker

```sh
npx shadcn@latest add @tidal-pro/timezone-picker
```

Stylesheets: `components/ui/tidal.css`, `components/ui/timezone-picker.css`.

## Minimal example

```tsx
import"./components/ui/tidal.css";
import"./components/ui/timezone-picker.css";
import{TidalTimezonePicker}from"./components/ui/timezone-picker";
export default(p:Parameters<typeof TidalTimezonePicker>[0])=><div className="tidal-scope"><TidalTimezonePicker {...p}/></div>;
```

## Structured props

- `TidalTimezonePicker.label: ReactNode`: Required label value accepted by this exported component.
- `TidalTimezonePicker.name: string`: Required name value accepted by this exported component.
- `TidalTimezonePicker.onActiveZoneChange: (zoneId: string | undefined, event: TidalComboboxActiveEvent) => void`: Callback invoked when the active zone change interaction is proposed.
- `TidalTimezonePicker.onOpenChange: (open: boolean, event: TidalComboboxOpenEvent) => void`: Callback invoked when the open change interaction is proposed.
- `TidalTimezonePicker.onQueryChange: (value: string, event: ChangeEvent<HTMLInputElement>) => void`: Callback invoked when the query change interaction is proposed.
- `TidalTimezonePicker.onValueChange: (zone: TidalTimezoneOption, event: TidalComboboxSelectionEvent) => void`: Callback invoked when the value change interaction is proposed.
- `TidalTimezonePicker.open: boolean`: Required open value accepted by this exported component.
- `TidalTimezonePicker.query: string`: Required query value accepted by this exported component.
- `TidalTimezonePicker.referenceInstant: number | Date`: Required reference instant value accepted by this exported component.
- `TidalTimezonePicker.value: string`: Required value value accepted by this exported component.
- `TidalTimezonePicker.zones: ReadonlyArray<TidalTimezoneOption>`: Required zones value accepted by this exported component.
- `TidalTimezonePicker.activeZoneId?: string | undefined`: Optional active zone id value accepted by this exported component.
- `TidalTimezonePicker.description?: ReactNode`: Optional description value accepted by this exported component.
- `TidalTimezonePicker.disabled?: boolean | undefined` (default false): Optional disabled value accepted by this exported component.
- `TidalTimezonePicker.emptyMessage?: ReactNode` (default "No time zones match this search."): Optional empty message value accepted by this exported component.
- `TidalTimezonePicker.error?: ReactNode`: Optional error value accepted by this exported component.
- `TidalTimezonePicker.form?: string | undefined`: Optional form value accepted by this exported component.
- `TidalTimezonePicker.formatOffset?: ((offsetMinutes: number, zone: TidalTimezoneOption, referenceInstant: number) => string) | undefined` (default defaultOffsetLabel): Optional format offset value accepted by this exported component.
- `TidalTimezonePicker.hiddenInputProps?: Omit<Omit<InputHTMLAttributes<HTMLInputElement>, "disabled" | "form" | "name" | "type" | "value" | "defaultValue" | "children" | "dangerouslySetInnerHTML" | "readOnly">, "dangerouslySetInnerHTML" | "required"> | undefined`: Optional hidden input props value accepted by this exported component.
- `TidalTimezonePicker.hiddenInputRef?: Ref<HTMLInputElement> | undefined`: Optional hidden input ref value accepted by this exported component.
- `TidalTimezonePicker.hint?: ReactNode`: Optional hint value accepted by this exported component.
- `TidalTimezonePicker.inputProps?: Omit<Omit<InputHTMLAttributes<HTMLInputElement>, "disabled" | "type" | "value" | "defaultValue" | "role" | "aria-activedescendant" | "aria-autocomplete" | "aria-controls" | "aria-disabled" | "aria-expanded" | "aria-readonly" | "children" | "dangerouslySetInnerHTML" | "placeholder" | "readOnly">, "name" | "dangerouslySetInnerHTML" | "required"> | undefined`: Optional input props value accepted by this exported component.
- `TidalTimezonePicker.inputRef?: Ref<HTMLInputElement> | undefined`: Optional input ref value accepted by this exported component.
- `TidalTimezonePicker.labels?: Partial<TidalTimezonePickerLabels> | undefined`: Optional labels value accepted by this exported component.
- `TidalTimezonePicker.placeholder?: string | undefined` (default "Search time zones"): Optional placeholder value accepted by this exported component.
- `TidalTimezonePicker.readOnly?: boolean | undefined` (default false): Optional read only value accepted by this exported component.
- `TidalTimezonePicker.toggleButtonProps?: Omit<Omit<ButtonHTMLAttributes<HTMLButtonElement>, "disabled" | "type" | "aria-controls" | "aria-disabled" | "aria-expanded" | "aria-label" | "children" | "dangerouslySetInnerHTML">, "dangerouslySetInnerHTML"> | undefined`: Optional toggle button props value accepted by this exported component.
- `TidalTimezonePicker.toggleButtonRef?: Ref<HTMLButtonElement> | undefined`: Optional toggle button ref value accepted by this exported component.

## Complete usage example

[Source](https://tidalui.com/examples/timezone-picker.tsx) | [Manifest](https://tidalui.com/examples/timezone-picker.json). Install the listed additional dependencies. Consumer fixture: TypeScript pass; Vite pass. This fixture check is distinct from the actual shadcn install receipt.

```tsx
"use client";

import "./components/ui/tidal.css";

import { useId, useRef, useState } from "react";

import { TidalTimezonePicker, type TidalTimezoneOption } from "./components/ui/timezone-picker";

import "./components/ui/timezone-picker.css";

import "./components/ui/combobox.css";



const tidalExampleStyles = ".timezone-picker-demo {\n  display: grid;\n  width: min(100%, 580px);\n  min-width: 0;\n  gap: 14px;\n}\n\n.timezone-picker-demo-actions {\n  display: flex;\n  flex-wrap: wrap;\n  gap: 9px;\n}\n\n.timezone-picker-demo-actions button {\n  min-width: 44px;\n  min-height: 44px;\n  padding: 10px 14px;\n  border: 1px solid var(--t-border);\n  border-radius: 10px;\n  background: var(--t-surface);\n  color: var(--t-ink);\n  font: inherit;\n  font-size: 11px;\n  font-weight: 650;\n  cursor: pointer;\n}\n\n.timezone-picker-demo-actions button:first-child {\n  border-color: var(--t-ink);\n  background: var(--t-ink);\n  color: var(--t-surface);\n}\n\n.timezone-picker-demo-actions button:focus-visible {\n  outline: 2px solid var(--t-accent);\n  outline-offset: 3px;\n}\n\n.timezone-picker-demo output,\n.timezone-picker-demo > small {\n  min-width: 0;\n  color: var(--t-muted);\n  font-size: 11px;\n  line-height: 1.55;\n  overflow-wrap: anywhere;\n}\n\n@media (max-width: 420px), (pointer: coarse) {\n  .timezone-picker-demo-actions button {\n    font-size: 16px;\n  }\n}\n\n@media (max-width: 420px) {\n  .timezone-picker-demo-actions {\n    display: grid;\n  }\n\n  .timezone-picker-demo-actions button {\n    width: 100%;\n  }\n}";

const REFERENCE_INSTANT = Date.UTC(2026, 9, 15, 17, 0, 0);

const ZONES: readonly TidalTimezoneOption[] = [
  {
    id: "los-angeles",
    timeZone: "America/Los_Angeles",
    label: "Pacific time",
    region: "United States west coast",
    searchTerms: ["PST", "PDT"],
  },
  {
    id: "denver",
    timeZone: "America/Denver",
    label: "Mountain time",
    region: "United States mountain",
    searchTerms: ["MST", "MDT"],
  },
  {
    id: "chicago",
    timeZone: "America/Chicago",
    label: "Central time",
    region: "United States central",
    searchTerms: ["CST", "CDT"],
  },
  {
    id: "new-york",
    timeZone: "America/New_York",
    label: "Eastern time",
    region: "United States east coast",
    searchTerms: ["EST", "EDT"],
  },
  {
    id: "utc",
    timeZone: "UTC",
    label: "Coordinated Universal Time",
    searchTerms: ["GMT", "zero offset"],
  },
  {
    id: "london",
    timeZone: "Europe/London",
    label: "London",
    region: "United Kingdom",
    searchTerms: ["GMT", "BST"],
  },
  {
    id: "kolkata",
    timeZone: "Asia/Kolkata",
    label: "India time",
    region: "India",
    searchTerms: ["IST", "half hour"],
  },
  {
    id: "tokyo",
    timeZone: "Asia/Tokyo",
    label: "Tokyo",
    region: "Japan",
    searchTerms: ["JST"],
  },
];

export function TimezonePickerDemo() {
  const generatedId = useId().replace(/:/g, "");
  const formId = `timezone-picker-${generatedId}-form`;
  const inputRef = useRef<HTMLInputElement>(null);
  const [query, setQuery] = useState("Central time");
  const [open, setOpen] = useState(false);
  const [activeZoneId, setActiveZoneId] = useState<string | undefined>();
  const [value, setValue] = useState("America/Chicago");
  const [status, setStatus] = useState(
    "The sample reference instant is October 15, 2026 at 17:00 UTC.",
  );

  function resetSample() {
    setQuery("Central time");
    setOpen(false);
    setActiveZoneId(undefined);
    setValue("America/Chicago");
    setStatus("The local time zone sample was reset.");
  }

  return (
    <form
      id={formId}
      className="timezone-picker-demo"
      onSubmit={(event) => {
        event.preventDefault();
        const data = new FormData(event.currentTarget);
        const submitted = data.get("sampleTimeZone");
        setStatus(
          submitted
            ? `Prepared time zone: ${String(submitted)}.`
            : "Choose a time zone before reviewing the sample.",
        );
      }}
      onReset={resetSample}
    >
      <TidalTimezonePicker
        label="Workspace time zone"
        description="Offsets are calculated for the sample reference instant."
        name="sampleTimeZone"
        form={formId}
        zones={ZONES}
        referenceInstant={REFERENCE_INSTANT}
        value={value}
        query={query}
        open={open}
        activeZoneId={activeZoneId}
        inputRef={inputRef}
        onQueryChange={(nextQuery) => {
          setQuery(nextQuery);
          setActiveZoneId(undefined);
        }}
        onOpenChange={setOpen}
        onActiveZoneChange={setActiveZoneId}
        onValueChange={(zone) => {
          setValue(zone.timeZone);
          setQuery(zone.label);
          setStatus(`${zone.label} is selected in this local sample.`);
        }}
        hint="Search by city, region, abbreviation, IANA name or reference offset."
      />
      <div className="timezone-picker-demo-actions">
        <button type="submit">Review time zone</button>
        <button type="reset">Reset sample</button>
      </div>
      <output aria-live="polite">{status}</output>
      <small>No location is detected and no account setting is changed.</small>
    </form>
  );
}

export default function AgentExample() {
  return (
    <div className="tidal-scope" data-theme="light" dir="ltr">
      <style>{tidalExampleStyles}</style>
      <TimezonePickerDemo />
    </div>
  );
}

```

## Gotchas

- Keep field state, validation results, submission, and persistence in the host form workflow.

## Theme and accessibility

{"tokens":["--t-accent","--t-border","--t-border-strong","--t-canvas","--t-danger","--t-display","--t-ease-out","--t-ease-spring","--t-faint","--t-font","--t-ink","--t-line","--t-muted","--t-primary","--t-primary-contrast","--t-radius-card","--t-radius-control","--t-radius-overlay","--t-radius-panel","--t-ring","--t-shadow-lg","--t-shadow-soft","--t-soft","--t-subtle","--t-surface","--t-wash"],"darkMode":true}

{"keyboard":["Tab and Shift+Tab follow the component's native focus order.","Arrow-key behavior follows the exported composite-control implementation."],"aria":"The component wires labels and relationships from consumer-provided visible text or ARIA props; preserve those labels in production.","notes":"Verify focus visibility, text alternatives, contrast, and reduced motion in the final composition."}

Requires consumer-supplied unique zone IDs, unique valid IANA timeZone values, plain labels, a finite Date or epoch-millisecond referenceInstant, controlled IANA value/query/open/activeZoneId state and callbacks. Search matches supplied labels, regions, terms, IANA names and the offset at that exact instant; the native hidden form value is the selected IANA name. Optional formatter, label text, description/hint/error/empty content, form owner, disabled/readOnly state and root/input/hidden/toggle props and refs are supported. Invalid configuration renders an alert. The component performs no geolocation, time-zone discovery, account change, request, storage or scheduling.
