View as Markdown

API reference: @salmonui/calendars/time-picker

TimePickercomponent

import { TimePicker } from '@salmonui/calendars/time-picker';
function TimePicker(props: TimePickerProps): import("react").JSX.Element;

Props: TimePickerProps

TimePicker props (46)
NameSignatureDescription
openoptionalinheritedopen?: boolean;
defaultOpenoptionalinheriteddefaultOpen?: boolean;
onOpenChangeoptionalinheritedonOpenChange?: ((open: boolean, details: PickerOpenChangeDetails) => void);
popupModeoptionalinheritedpopupMode?: PopupMode;
disabledoptionalinheriteddisabled?: boolean;
readOnlyoptionalinheritedreadOnly?: boolean;
valueoptionalreadonly value?: TimeInput | null | undefined;
defaultValueoptionalreadonly defaultValue?: TimeInput | null | undefined;
onValueChangeoptionalreadonly onValueChange?: ((value: PlainTime | null, details: TimePickerValueChangeDetails) => void) | undefined;
stepoptionalreadonly step?: number | undefined;

Minutes between list options (default 30).

minoptionalreadonly min?: TimeInput | null | undefined;
maxoptionalreadonly max?: TimeInput | null | undefined;
isTimeDisabledoptionalreadonly isTimeDisabled?: ((time: PlainTime) => boolean) | undefined;

Disabled times: skipped in the list, invalid when typed.

granularityoptionalreadonly granularity?: 'hour' | 'minute' | 'second' | undefined;

Deepest segment (default 'minute').

formatoptionalreadonly format?: DateFormat | undefined;

Display format of the field (Intl options, a skeleton or a pattern); Intl options also format the option labels.

placeholderValueoptionalreadonly placeholderValue?: TimeInput | null | undefined;

List position and segment seed without a value.

renderOptionoptionalreadonly renderOption?: ((ctx: TimeOptionContext) => ReactNode) | undefined;

Option content.

localeTextoptionalreadonly localeText?: Partial<TimePickerLocaleText> | undefined;
refoptionalreadonly ref?: Ref<PickerHandle> | undefined;
openOnFocusoptionalinheritedopenOnFocus?: boolean;

Opens the popup when focus enters the field.

editableoptionalinheritededitable?: boolean;

false makes the segments read-only; a click on the field opens the popup.

clearableoptionalinheritedclearable?: boolean;

Renders a clear button.

onClearoptionalinheritedonClear?: (() => void);
strictoptionalinheritedstrict?: boolean;

Out-of-range values move to the nearest bound and disabled or unparsable input reverts on blur.

requiredoptionalinheritedrequired?: boolean;
invalidoptionalinheritedinvalid?: boolean;
labeloptionalinheritedlabel?: ReactNode;
descriptionoptionalinheriteddescription?: ReactNode;
errorMessageoptionalinheritederrorMessage?: ReactNode;
placeholderoptionalinheritedplaceholder?: string;

Watermark shown while empty and not focused.

nameoptionalinheritedname?: string;
formoptionalinheritedform?: string;
autoFocusoptionalinheritedautoFocus?: boolean;
onFocusoptionalinheritedonFocus?: ((event: FocusEvent<Element, Element>) => void);

Focus entered the field group (once).

onBluroptionalinheritedonBlur?: ((event: FocusEvent<Element, Element>) => void);

Focus left the field group and its popup (once).

onInvalidoptionalinheritedonInvalid?: (() => void);

The form value input failed constraint validation.

localeoptionalinheritedlocale?: string;

BCP 47 locale; default 'en-US'.

timeZoneoptionalinheritedtimeZone?: string;

IANA time zone for instant values (Date, ISO with an offset).

hourCycleoptionalinheritedhourCycle?: "h12" | "h23";
sizeoptionalinheritedsize?: "lg" | "md" | "sm";

Control size: 'sm' 24px, 'md' 32px (default), 'lg' 40px tall.

idoptionalinheritedid?: string;
classNameoptionalinheritedclassName?: string;
styleoptionalinheritedstyle?: CSSProperties;
aria-labeloptionalinheritedaria-label?: string;
aria-labelledbyoptionalinheritedaria-labelledby?: string;
aria-describedbyoptionalinheritedaria-describedby?: string;