TidalUI

Timezone picker preview

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

pro · Forms · primitive

When to use

Alternatives

Configure components.json and the @tidal-pro namespace before installing Pro components.

Installation

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

Import components/ui/tidal.css, components/ui/timezone-picker.css. Wrap installed components in tidal-scope.

Preview

Timezone picker component preview

Open interactive preview

Minimal example

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>;

API and props

TidalTimezonePicker.label (required)
ReactNode

Required label value accepted by this exported component.

TidalTimezonePicker.name (required)
string

Required name value accepted by this exported component.

TidalTimezonePicker.onActiveZoneChange (required)
(zoneId: string | undefined, event: TidalComboboxActiveEvent) => void

Callback invoked when the active zone change interaction is proposed.

TidalTimezonePicker.onOpenChange (required)
(open: boolean, event: TidalComboboxOpenEvent) => void

Callback invoked when the open change interaction is proposed.

TidalTimezonePicker.onQueryChange (required)
(value: string, event: ChangeEvent<HTMLInputElement>) => void

Callback invoked when the query change interaction is proposed.

TidalTimezonePicker.onValueChange (required)
(zone: TidalTimezoneOption, event: TidalComboboxSelectionEvent) => void

Callback invoked when the value change interaction is proposed.

TidalTimezonePicker.open (required)
boolean

Required open value accepted by this exported component.

TidalTimezonePicker.query (required)
string

Required query value accepted by this exported component.

TidalTimezonePicker.referenceInstant (required)
number | Date

Required reference instant value accepted by this exported component.

TidalTimezonePicker.value (required)
string

Required value value accepted by this exported component.

TidalTimezonePicker.zones (required)
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

Optional disabled value accepted by this exported component.

TidalTimezonePicker.emptyMessage
ReactNode

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

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

Optional placeholder value accepted by this exported component.

TidalTimezonePicker.readOnly
boolean | undefined

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

Full example, stylesheet imports, API and accessibility documentation

Gotchas