TimeInput

An input field alllow user enter specify time.

Basic

Basic example of TimeInput.

Time range input

Basic example for TimeInputRange.

Controlled

Controlled usage.

Display seconds

We can also enable seconds for input.

Display AM or PM

Setting format prop to '12' to change time to 12 hours format

Sizes

There's three sizes of option for TimeInput.

Disabled

Disabled TimeInput.

Affix

TimeInput can have suffix or prefix content inside.

Invalid state

Display TimeInput as invalid status when invalid prop is set to true.

API

TimeInput
PropDescriptionTypeDefault
amLabelDisplay string for AM'string''am'
amPmPlaceholderPlaceholder for AM/PM field'string''am'
clearableWhether allow to clear valuebooleantrue
defaultValueDefault value of TimeInput (use value instead if it is controlled)Date-
disabledWhether TimeInput is disabledbooleanfalse
formatDetermine time format'12' | '24''24'
invalidWhether the TimeInput is invalid statusboolean-
nextRefRef to focus after final TimeInput field, can be used by TimeInputRangeRefObject-
onChangeCallback when TimeInput value changed(value: Date) => void-
pmLabelDisplay string for PM'string''pm'
prefixRender a prefix content inside TimeInputstring | ReactNode-
showSecondsWhether display seconds input fieldboolean-
sizeTimeInput size'lg' | 'md' | 'sm''md'
suffixRender a suffix content inside TimeInputstring | ReactNodeReactNode
timeFieldPlaceholderTime field placeholder'string''--'
timeFieldClassExtra class for time field'string'-
valueValue of TimeInput (Controlled)Date-
TimeInput.TimeInputRange
PropDescriptionTypeDefault
amLabelDisplay string for AM'string''am'
amPmPlaceholderPlaceholder for AM/PM field'string''am'
clearableWhether allow to clear valuebooleantrue
defaultValueDefault value of TimeInputRange (use value instead if it is controlled)Date-
disabledWhether TimeInputRange is disabledbooleanfalse
formatDetermine time format'12' | '24''24'
invalidWhether the TimeInputRange is invalid statusboolean-
nextRefRef to focus after final TimeInputRange field, can be used by TimeInputRangeRangeRefObject-
onChangeCallback when TimeInputRange value changed(value: Date) => void-
pmLabelDisplay string for PM'string''pm'
prefixRender a prefix content inside TimeInputRangestring | ReactNode-
separatorSeperator between time inputs 'string' | '24''~'
showSecondsWhether display seconds input fieldboolean-
sizeTimeInputRange size'lg' | 'md' | 'sm''md'
suffixRender a suffix content inside TimeInputRangestring | ReactNodeReactNode
timeFieldPlaceholderTime field placeholder'string''--'
timeFieldClassExtra class for time field'string'-
valueValue of TimeInputRange (Controlled)Date-