Components/Form
Interactive docs page: https://wix-pages.com/design-system-documentation/#/component/timeinput
Time inputs allow users to to enter or select a specific time value.
<NumberInput/> instead.Adjust the size of the input using the size prop. 3 sizes are supported:
medium.large when the time input needs emphasis.small.Control the width of the input with the width property. 2 values are supported:
auto.100%.Style the component using the border prop. It supports 4 styles:
standard.round.bottomLine to create an editable, underlined title field.none.Control the status of the time input using the status prop. It supports 3 states:
error demonstrates that something is missing or the entry was invalid. The conditions for an error status must be defined when using this prop.warning highlights an input value that might have a significant impact to the user or it can't be validated.loading shows when an input value is being uploaded to the server.Add text that explains the status or what action the user should take with the statusMessage prop.
Showing the status message inline, directly below the input is preferred in all default cases.
<FormField/> and add the statusMessage.statusMessage prop. Control tooltip placement with tooltipPlacement prop.View more inline status message examples in <FormField/>.
To add predefined validations to the Time Input, use the invalidMessage prop.
The error icon and tooltip message are triggered when a user enters an invalid syntax, e.g., 15
am.To exclude past times from the calendar view, use the excludePastTimes prop. To exclude specific times, use the filterTime prop.
The error message shows in a tooltip on hover over the icon by default. The message can be updated or removed.
Note: When both statusMessage and invalidMessage props are used, the input will display the statusMessage, unless internal validation fails. Then it would display the invalidMessage.
Disable all input interactions with the disabled prop. Use it to demonstrate that the user cannot select the time.
Add text, icons or a button at the beginning or end of an input field using prefix and suffix.
Specify a correct time formatting (e.g., AM/PM or military time) per country using the locale prop.
Control whether to display the time zone info with timeStyle. It supports 2 values:
short (the default) displays the time only.long shows the time together with the time zone.In a dropdown layout, control the interval between timestamps using the step prop.
By default, the interval between timestamps is 15 minutes.
The component's validations cover the following cases:
formatError: when a user enters a time that's invalid and impossible to parse.outOfBoundsError: when a user types in a time out of the accepted range. This validation is triggered when the excludePastTimes or filterTime props are enabled.Note: In order for the error to be cleared, use onChange. This way, the error will not show when the user enters a valid time.
To apply custom validations to the component, use information returned by onChange and onInvalid props. The onInvalid prop provides validationType and input value parameters.
Requires use of external package. In this example use-mask-input package is used.
Use the time input together with a <DatePicker/> to schedule specific times for events, appointments, delivery hours, etc.
Use the <Range/> component to merge two input fields to specify a time duration.
| Name | Type | Default | Description |
|---|---|---|---|
autoSelect | boolean | — | Specifies whether input is auto selected on focus. |
backgroundColor | string | — | Sets the background color of the input. Accepts any CSS color value. |
border | "none" | "standard" | "round" | "bottomLine" | — | Control the border style of input. |
customInput | null | string | number | false | true | Function | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | — | Render a custom component in place of the default <input>. Must be a React.forwardRef component that forwards the ref to a real <input>. |
dataHook | string | — | Applies a data-hook HTML attribute that can be used in the tests. |
disableAutoComplete | boolean | — | Disables the auto-suggest UX (closest-time pre-fill, suggestion autofill, mid-typing format validation). The dropdown still works as a picker. Use when integrating an external input mask. Format errors surface on blur. |
disabled | boolean | — | Specifies whether component is disabled. |
disableKeyboardType | boolean | — | Specifies whether typing into the field is blocked, leaving the stepper controls as the only way to change the time. |
enterKeyHint | "search" | "enter" | "done" | "go" | "next" | "previous" | "send" | — | Sets the label of the virtual keyboard's enter key on touch devices. |
excludePastTimes | boolean | — | Specify whether past time slots should be shown or not. |
filterTime | (time: Date) => boolean | — | Specify selectable time slots: * param {Date} value - a time to check * return {boolean} - true if value should be shown in time slots dropdown, false otherwise |
hideStatusSuffix | boolean | — | Specifies whether status suffix is hidden. |
inputmode | string | — | Sets the native inputmode attribute, which picks the virtual keyboard on touch devices. Supported values are none, text, decimal, numeric, tel, search, email and url. |
inputRef | null | (instance: HTMLInputElement | null) => void | RefObject<HTMLInputElement> | — | Ref to the underlying <input> DOM element. Accepts callback and object refs. Use for input masking libraries. Memoize callback refs to avoid reattaching. |
invalidMessage | string | — | Enables internal validation and defines a message to display when user types invalid time value. |
locale | "th" | "tr" | "id" | "fr" | "no" | "en" | "en-US" | "en-GB" | "en-AU" | "en-CA" | "ar" | "bg" | "ca" | "zh" | "zh-TW" | "zh-HK" | "zh-MO" | "cs" | "da" | "nl" | "fi" | "fr-CA" | "fr-CH" | "fr-BE" | "de" | "de-CH" | "de-AT" | "el" | "he" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "ms" | "nb" | "nn" | "pl" | "pt-BR" | "pt" | "ro" | "ru" | "sk" | "sl" | "es" | "es-419" | "es-AR" | "es-MX" | "es-US" | "sv" | "tl" | "uk" | "vi" | — | Sets locale and formats time according to it. |
onBlur | FocusEventHandler | — | Defines a standard input onBlur callback. |
onChange | ({ date }: { date: Date | null; }) => void | — | Defines a callback function which is called on every time value changes. |
onFocus | FocusEventHandler | — | Defines a standard input onFocus callback. |
onInvalid | (info: { validationType: "outOfBoundsError" | "formatError"; value: string; }) => void | — | Defines a callback function which is called on cases when invalid time is typed or confirmed with an action. - return {{ validationType: 'formatError' | 'outOfBoundsError', value: string }} - validationType - type 'formatError'is set when value is in the wrong time format - type 'outOfBoundsError' is set when excludePastTimes or filterTime is used and value doesn't match the filters - value - is set to current input value |
placeholder | string | — | Sets a placeholder message to display. |
popoverProps | PopoverCommonProps | — | Allows to pass all common popover props. |
prefix | ReactNode | — | Pass a component you want to show as the prefix of the input, e.g., text, icon. |
readOnly | boolean | — | Specifies whether input is read only. |
ref | null | string | (instance: TimeInputImperativeActions | null) => void | RefObject<TimeInputImperativeActions> | — | Allows getting a ref to the component instance. Once the component unmounts, React will set ref.current to null (or call the ref with null if you passed a callback ref). |
size | "small" | "tiny" | "medium" | "large" | — | Controls the size of the input. |
status | "error" | "warning" | "loading" | — | Specify the status of a field. |
statusMessage | ReactNode | — | Defines the message to display on status icon hover. If not given or empty, no tooltip is displayed. |
step | number | 15 | Specifies the interval between time values shown in dropdown. |
suffix | ReactNode | — | Pass a component you want to show as the suffix of the input, e.g., text, icon. |
timeStyle | "short" | "long" | — | Specifies what time formatting style to use when calling format() |
value | null | Date | — | Specifies the current value of the input. |
width | string | number | string & {} | — | Controls the width of the component. auto resizes the input to match the width of its contents, while 100% takes up the full parent container width. |
No testkit for this component — it doesn't expose a unidriver testkit.
WixDesignSystemProvider with mobile, tapping the field opens the list of times and keeps it open until a time is picked or the drawer is dismissed, and onBlur fires once the drawer closes rather than on the tap. DropdownBase: new onClose(reason) callback, so a parent that controls open can close it on an outside press, Esc or a drawer drag, and a tap on the mobile drawer's overlay now reaches onClickOutside as on desktop. Drawer: onClose receives the reason ('outside-press', 'escape-key', 'drag' or 'focus-out') as a second argument. (#17289)Last updated: 30 October 2026