Skip to content

TimeInput

Time picker input field with optional seconds granularity.

(args: TimeInputProps) => {
const [value, setValue] = useState<PlainTime | null>(TIME_0900);
return <TimeInput {...args} onChange={setValue} value={value} />;
}
(args: TimeInputProps) => {
const [value, setValue] = useState<PlainTime | null>(TIME_090030);
return <TimeInput {...args} onChange={setValue} value={value} />;
}
(args: TimeInputProps) => {
const [value, setValue] = useState<PlainTime | null>(TIME_1430);
return <TimeInput {...args} onChange={setValue} value={value} />;
}
(args: TimeInputProps) => {
const [value, setValue] = useState<PlainTime | null>(TIME_1200);
return <TimeInput {...args} onChange={setValue} value={value} />;
}
<TimeInput {...args} onChange={() => {}} value={TIME_0900} />
<TimeInput {...args} onChange={() => {}} value={TIME_0900} />
(args: TimeInputProps) => {
const [value, setValue] = useState<PlainTime | null>(null);
return <TimeInput {...args} onChange={setValue} value={value} />;
}
Outside business hours
(args: TimeInputProps) => {
const [value, setValue] = useState<PlainTime | null>(TIME_2200);
return <TimeInput {...args} onChange={setValue} value={value} />;
}
Time slot available
(args: TimeInputProps) => {
const [value, setValue] = useState<PlainTime | null>(TIME_1000);
return <TimeInput {...args} onChange={setValue} value={value} />;
}
() => {
const [sm, setSm] = useState<PlainTime | null>(TIME_0900);
const [md, setMd] = useState<PlainTime | null>(TIME_0900);
const [lg, setLg] = useState<PlainTime | null>(TIME_0900);
return (
<div style={{display: 'flex', flexDirection: 'column', gap: 16}}>
<TimeInput label="Small" onChange={setSm} size="sm" value={sm} />
<TimeInput label="Medium" onChange={setMd} size="md" value={md} />
<TimeInput label="Large" onChange={setLg} size="lg" value={lg} />
</div>
);
}
(args: TimeInputProps) => {
const [value, setValue] = useState<PlainTime | null>(TIME_0900);
return <TimeInput {...args} onChange={setValue} value={value} />;
}
(args: TimeInputProps) => {
const [value, setValue] = useState<PlainTime | null>(TIME_0900);
return <TimeInput {...args} onChange={setValue} value={value} />;
}
Select a time in your local timezone.
(args: TimeInputProps) => {
const [value, setValue] = useState<PlainTime | null>(TIME_0900);
return <TimeInput {...args} onChange={setValue} value={value} />;
}
(args: TimeInputProps) => {
const [value, setValue] = useState<PlainTime | null>(TIME_0900);
return <TimeInput {...args} onChange={setValue} value={value} />;
}
(args: TimeInputProps) => {
const [value, setValue] = useState<PlainTime | null>(TIME_0900);
return <TimeInput {...args} onChange={setValue} value={value} />;
}
<TimeInput {...args} onChange={() => {}} value={TIME_0900} />

Time picker input field with optional seconds granularity.

When isOptional: false, isRequired: false

PropTypeDefaultDescription
classNamestringAdditional CSS class names applied to the input wrapper.
data-testidstringTest ID applied to the input element.
descriptionReactNodeSupporting text displayed below the label.
hasAutoFocusbooleanfalseWhether to focus the input on mount.
hasClearbooleanfalseWhether to show a clear button when a value is set.
hasSecondsbooleanfalseWhether the input includes a seconds field.
htmlNamestringHTML name attribute.
isDisabledbooleanfalseWhether the input is disabled.
isLabelHiddenbooleanfalseWhether to visually hide the label.
isLoadingbooleanfalseWhether the input is loading.
isReadOnlybooleanfalseWhether the value is displayed without allowing focus or interaction.
label*stringField label.
labelIconIconComponentIcon shown before the label.
labelTooltipReactNodeTooltip content shown next to the label.
maxPlainTimeLatest allowed time.
minPlainTimeEarliest allowed time.
onBlur(event: FocusEvent<HTMLInputElement>) => voidCalled when the input loses focus.
onChange*(value: PlainTime | null) => voidCalled when the time value changes.
onFocus(event: FocusEvent<HTMLInputElement>) => voidCalled when the input gains focus.
placeholderstring'Select a time'Placeholder text.
refRef<HTMLInputElement>Ref forwarded to the input element.
size"sm" | "md" | "lg"'md'Visual size.
statusInputStatusValidation status displayed below the input.
stepnumberStep increment in seconds for the time picker.
styleCSSPropertiesInline styles applied to the input wrapper.
value*PlainTime | nullControlled time value. Pass null for an empty input.
isOptionalfalse
isRequiredfalse

When isOptional: true, isRequired: false

PropTypeDefaultDescription
classNamestringAdditional CSS class names applied to the input wrapper.
data-testidstringTest ID applied to the input element.
descriptionReactNodeSupporting text displayed below the label.
hasAutoFocusbooleanfalseWhether to focus the input on mount.
hasClearbooleanfalseWhether to show a clear button when a value is set.
hasSecondsbooleanfalseWhether the input includes a seconds field.
htmlNamestringHTML name attribute.
isDisabledbooleanfalseWhether the input is disabled.
isLabelHiddenbooleanfalseWhether to visually hide the label.
isLoadingbooleanfalseWhether the input is loading.
isReadOnlybooleanfalseWhether the value is displayed without allowing focus or interaction.
label*stringField label.
labelIconIconComponentIcon shown before the label.
labelTooltipReactNodeTooltip content shown next to the label.
maxPlainTimeLatest allowed time.
minPlainTimeEarliest allowed time.
onBlur(event: FocusEvent<HTMLInputElement>) => voidCalled when the input loses focus.
onChange*(value: PlainTime | null) => voidCalled when the time value changes.
onFocus(event: FocusEvent<HTMLInputElement>) => voidCalled when the input gains focus.
placeholderstring'Select a time'Placeholder text.
refRef<HTMLInputElement>Ref forwarded to the input element.
size"sm" | "md" | "lg"'md'Visual size.
statusInputStatusValidation status displayed below the input.
stepnumberStep increment in seconds for the time picker.
styleCSSPropertiesInline styles applied to the input wrapper.
value*PlainTime | nullControlled time value. Pass null for an empty input.
isOptional*true
isRequiredfalse

When isOptional: false, isRequired: true

PropTypeDefaultDescription
classNamestringAdditional CSS class names applied to the input wrapper.
data-testidstringTest ID applied to the input element.
descriptionReactNodeSupporting text displayed below the label.
hasAutoFocusbooleanfalseWhether to focus the input on mount.
hasClearbooleanfalseWhether to show a clear button when a value is set.
hasSecondsbooleanfalseWhether the input includes a seconds field.
htmlNamestringHTML name attribute.
isDisabledbooleanfalseWhether the input is disabled.
isLabelHiddenbooleanfalseWhether to visually hide the label.
isLoadingbooleanfalseWhether the input is loading.
isReadOnlybooleanfalseWhether the value is displayed without allowing focus or interaction.
label*stringField label.
labelIconIconComponentIcon shown before the label.
labelTooltipReactNodeTooltip content shown next to the label.
maxPlainTimeLatest allowed time.
minPlainTimeEarliest allowed time.
onBlur(event: FocusEvent<HTMLInputElement>) => voidCalled when the input loses focus.
onChange*(value: PlainTime | null) => voidCalled when the time value changes.
onFocus(event: FocusEvent<HTMLInputElement>) => voidCalled when the input gains focus.
placeholderstring'Select a time'Placeholder text.
refRef<HTMLInputElement>Ref forwarded to the input element.
size"sm" | "md" | "lg"'md'Visual size.
statusInputStatusValidation status displayed below the input.
stepnumberStep increment in seconds for the time picker.
styleCSSPropertiesInline styles applied to the input wrapper.
value*PlainTime | nullControlled time value. Pass null for an empty input.
isOptionalfalse
isRequired*true