# @salmonui/calendars/time-picker API reference

> 33 exported symbols of @salmonui/calendars/time-picker: 2 components, 5 functions, 15 interfaces, 10 types and 1 constant.

Canonical: https://salmonui.dev/docs/reference/calendars/time-picker

```ts
import { … } from '@salmonui/calendars/time-picker';
```

## Components

### TimePicker

Kind: component

Page: https://salmonui.dev/docs/reference/calendars/time-picker/TimePicker

```ts
function TimePicker(props: TimePickerProps): import("react").JSX.Element;
```

Props: [`TimePickerProps`](https://salmonui.dev/docs/reference/calendars/time-picker/TimePickerProps) (its members are the props)

## Interfaces

### TimePickerLocaleText

Kind: interface

Page: https://salmonui.dev/docs/reference/calendars/time-picker/TimePickerLocaleText

```ts
interface TimePickerLocaleText {
    readonly openTimeList: PickerMessage;
    readonly clear: PickerMessage;
    readonly timeList: PickerMessage;
    readonly rangeUnderflow: PickerMessage;
    readonly rangeOverflow: PickerMessage;
    readonly unavailable: PickerMessage;
}
```

UI strings of `TimePicker` (`localeText`).

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `openTimeList` | `readonly openTimeList: PickerMessage;` |  |  |
| `clear` | `readonly clear: PickerMessage;` |  |  |
| `timeList` | `readonly timeList: PickerMessage;` |  |  |
| `rangeUnderflow` | `readonly rangeUnderflow: PickerMessage;` |  | Validity message for a value before `min` (`{min}`). |
| `rangeOverflow` | `readonly rangeOverflow: PickerMessage;` |  | Validity message for a value after `max` (`{max}`). |
| `unavailable` | `readonly unavailable: PickerMessage;` |  |  |

### TimePickerProps

Kind: interface

Page: https://salmonui.dev/docs/reference/calendars/time-picker/TimePickerProps

```ts
interface TimePickerProps extends PickerFieldProps {
    readonly value?: TimeInput | null | undefined;
    readonly defaultValue?: TimeInput | null | undefined;
    readonly onValueChange?: ((value: PlainTime | null, details: TimePickerValueChangeDetails) => void) | undefined;
    readonly step?: number | undefined;
    readonly min?: TimeInput | null | undefined;
    readonly max?: TimeInput | null | undefined;
    readonly isTimeDisabled?: ((time: PlainTime) => boolean) | undefined;
    readonly granularity?: 'hour' | 'minute' | 'second' | undefined;
    readonly format?: DateFormat | undefined;
    readonly placeholderValue?: TimeInput | null | undefined;
    readonly renderOption?: ((ctx: TimeOptionContext) => ReactNode) | undefined;
    readonly localeText?: Partial<TimePickerLocaleText> | undefined;
    readonly ref?: Ref<PickerHandle> | undefined;
}
```

Members (46):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `open` | `open?: boolean;` | optional, inherited |  |
| `defaultOpen` | `defaultOpen?: boolean;` | optional, inherited |  |
| `onOpenChange` | `onOpenChange?: ((open: boolean, details: PickerOpenChangeDetails) => void);` | optional, inherited |  |
| `popupMode` | `popupMode?: PopupMode;` | optional, inherited |  |
| `disabled` | `disabled?: boolean;` | optional, inherited |  |
| `readOnly` | `readOnly?: boolean;` | optional, inherited |  |
| `value` | `readonly value?: TimeInput \| null \| undefined;` | optional |  |
| `defaultValue` | `readonly defaultValue?: TimeInput \| null \| undefined;` | optional |  |
| `onValueChange` | `readonly onValueChange?: ((value: PlainTime \| null, details: TimePickerValueChangeDetails) => void) \| undefined;` | optional |  |
| `step` | `readonly step?: number \| undefined;` | optional | Minutes between list options (default 30). |
| `min` | `readonly min?: TimeInput \| null \| undefined;` | optional |  |
| `max` | `readonly max?: TimeInput \| null \| undefined;` | optional |  |
| `isTimeDisabled` | `readonly isTimeDisabled?: ((time: PlainTime) => boolean) \| undefined;` | optional | Disabled times: skipped in the list, invalid when typed. |
| `granularity` | `readonly granularity?: 'hour' \| 'minute' \| 'second' \| undefined;` | optional | Deepest segment (default `'minute'`). |
| `format` | `readonly format?: DateFormat \| undefined;` | optional | Display format of the field (`Intl` options, a skeleton or a pattern); `Intl` options also format the option labels. |
| `placeholderValue` | `readonly placeholderValue?: TimeInput \| null \| undefined;` | optional | List position and segment seed without a value. |
| `renderOption` | `readonly renderOption?: ((ctx: TimeOptionContext) => ReactNode) \| undefined;` | optional | Option content. |
| `localeText` | `readonly localeText?: Partial<TimePickerLocaleText> \| undefined;` | optional |  |
| `ref` | `readonly ref?: Ref<PickerHandle> \| undefined;` | optional |  |
| `openOnFocus` | `openOnFocus?: boolean;` | optional, inherited | Opens the popup when focus enters the field. |
| `editable` | `editable?: boolean;` | optional, inherited | `false` makes the segments read-only; a click on the field opens the popup. |
| `clearable` | `clearable?: boolean;` | optional, inherited | Renders a clear button. |
| `onClear` | `onClear?: (() => void);` | optional, inherited |  |
| `strict` | `strict?: boolean;` | optional, inherited | Out-of-range values move to the nearest bound and disabled or unparsable input reverts on blur. |
| `required` | `required?: boolean;` | optional, inherited |  |
| `invalid` | `invalid?: boolean;` | optional, inherited |  |
| `label` | `label?: ReactNode;` | optional, inherited |  |
| `description` | `description?: ReactNode;` | optional, inherited |  |
| `errorMessage` | `errorMessage?: ReactNode;` | optional, inherited |  |
| `placeholder` | `placeholder?: string;` | optional, inherited | Watermark shown while empty and not focused. |
| `name` | `name?: string;` | optional, inherited |  |
| `form` | `form?: string;` | optional, inherited |  |
| `autoFocus` | `autoFocus?: boolean;` | optional, inherited |  |
| `onFocus` | `onFocus?: ((event: FocusEvent<Element, Element>) => void);` | optional, inherited | Focus entered the field group (once). |
| `onBlur` | `onBlur?: ((event: FocusEvent<Element, Element>) => void);` | optional, inherited | Focus left the field group and its popup (once). |
| `onInvalid` | `onInvalid?: (() => void);` | optional, inherited | The form value input failed constraint validation. |
| `locale` | `locale?: string;` | optional, inherited | BCP 47 locale; default `'en-US'`. |
| `timeZone` | `timeZone?: string;` | optional, inherited | IANA time zone for instant values (`Date`, ISO with an offset). |
| `hourCycle` | `hourCycle?: "h12" \| "h23";` | optional, inherited |  |
| `size` | `size?: "lg" \| "md" \| "sm";` | optional, inherited | Control size: `'sm'` 24px, `'md'` 32px (default), `'lg'` 40px tall. |
| `id` | `id?: string;` | optional, inherited |  |
| `className` | `className?: string;` | optional, inherited |  |
| `style` | `style?: CSSProperties;` | optional, inherited |  |
| `aria-label` | `aria-label?: string;` | optional, inherited |  |
| `aria-labelledby` | `aria-labelledby?: string;` | optional, inherited |  |
| `aria-describedby` | `aria-describedby?: string;` | optional, inherited |  |

### TimePickerValueChangeDetails

Kind: interface

Page: https://salmonui.dev/docs/reference/calendars/time-picker/TimePickerValueChangeDetails

```ts
interface TimePickerValueChangeDetails {
    readonly source: ChangeSource;
    readonly reason: 'input' | 'option' | 'clear' | 'reset' | 'strict';
    readonly iso: string;
}
```

Second argument of `onValueChange`.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `source` | `readonly source: ChangeSource;` |  |  |
| `reason` | `readonly reason: 'input' \| 'option' \| 'clear' \| 'reset' \| 'strict';` |  |  |
| `iso` | `readonly iso: string;` |  | The form value: `HH:mm` or `HH:mm:ss` (`''` when empty). |

## Constants

### TIME_PICKER_DEFAULT_LOCALE_TEXT

Kind: const

Page: https://salmonui.dev/docs/reference/calendars/time-picker/TIME_PICKER_DEFAULT_LOCALE_TEXT

```ts
const TIME_PICKER_DEFAULT_LOCALE_TEXT: TimePickerLocaleText;
```

## Re-exported entry points

- [@salmonui/calendars/calendar](https://salmonui.dev/docs/reference/calendars/calendar.md): 17 symbols: 5 functions, 6 interfaces and 6 types
  `DateInput`, `DateRange`, `DateTimeInput`, `PlainDate`, `PlainDateLike`, `PlainDateTime`, `PlainDateTimeLike`, `PlainTime`, `PlainTimeLike`, `TimeInput`, `WeekRule`, `WeekdayFormat`, `getRangeDays`, `toDate`, `toPlainDate`, `toPlainDateTime`, `toPlainTime`
- [@salmonui/calendars/date-field](https://salmonui.dev/docs/reference/calendars/date-field.md): 5 symbols: 1 component, 3 interfaces and 1 type
  `FieldBaseProps`, `FieldChangeDetails`, `FieldLocaleText`, `TimeField`, `TimeFieldProps`
- [@salmonui/calendars/date-picker](https://salmonui.dev/docs/reference/calendars/date-picker.md): 6 symbols: 3 interfaces and 3 types
  `ChangeSource`, `PickerHandle`, `PickerMessage`, `PickerOpenChangeDetails`, `PopupMode`, `TimeOptionContext`
