Components/Form
Interactive docs page: https://wix-pages.com/design-system-documentation/#/component/input
Inputs let users enter short values into a text field. It can be used for forms and tables, or to build other form components like <AutoComplete/> or <NumberInput/>.
<InputArea/> component instead.<Search/> component instead.Adjust the size of the input using the size prop. It supports 3 sizes:
medium.large.small for more compact layout.tiny size for very compact layouts, use this size sparingly.Style the input using the border prop. It supports 4 styles:
standard.round.bottomLine to create an editable, underlined title field.none.Control the status of the input using the status prop. It supports 3 states:
error demonstrates that a required input is missing something or the entry was invalid.warning highlights an input value that might have a significant impact to a user.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/>.
Inputs can also be made read-only or disabled entirely.
readOnly disables adding or editing, but allows the user to copy the current value. Use it to display URLs, code, etc.disabledremoves all interactions and creates a disabled input state. Use it to highlight functions that are unavailable.Add text, icons or a button at the beginning or end of a text field using prefix and suffix.
Enable a button that lets users easily clear the input value by using the clearButton prop.
Control long text values with the textOverflow prop. There are 2 options:
clip (the default) cuts off text that is longer than the input field.ellipsis truncates the additional text with an ellipsis. This is especially useful with the bottomLine input style.rtl controls the text direction and layout behavior of the Input.
{false} (default): renders input in LTR mode.{true} renders input in RTL modeSince updating Business Manager to use Harmony theme, there has been added a new input background color. You can change it using backgroundColor property.
Important: this is only applicable to Harmony theme, on-stage color is always fixed to --wds-input-background-fill-on-stage
Requires use of external package. In this example use-mask-input package is used.
Requires use of external package. In this example react-imask package is used.
When multiple inputs represent the same kinds of data, like phone numbers or addresses, fields can be shown together under a single title using the <Layout/> component.
Inputs can also be used as card titles to help organize groups and files. This works best with the bottomLine border.
| Name | Type | Default | Description |
|---|---|---|---|
ariaControls | string | — | Associate a control with the regions that it controls. |
ariaDescribedby | string | — | Associate a region with its descriptions. Similar to aria-controls but instead associating descriptions to the region and description identifiers are separated with a space. |
ariaLabel | string | — | Define a string that labels the current element in case where a text label isn't visible on the screen. |
ariaRoledescription | string | — | Sets the aria-roledescription attribute of the <input> element, giving assistive technologies a readable description of its role. |
autocomplete | string | — | Sets the value of the native autocomplete attribute, for example off or email. |
autoFocus | boolean | — | Focus the element on mount (standard React input autoFocus) |
autoSelect | boolean | — | Automatically selects the entire input text. |
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. |
children | ReactNode | — | |
clearButton | boolean | — | Displays clear button (X) on a non-empty input. |
clearButtonAriaLabel | string | — | Aria label for the clear button. |
clearButtonTooltipContent | ReactNode | — | When provided, hovering displays a tooltip with this content. |
clearButtonTooltipProps | TooltipCommonProps | — | Clear button tooltip props. |
customInput | ReactNode | Function | — | Render a custom input instead of the default html input tag. |
dataHook | string | — | Applies a data-hook HTML attribute that can be used in the tests. |
defaultValue | string | number | — | Defines the initial value of an input. |
disabled | boolean | — | Specifies whether input should be disabled or not. |
disableEditing | boolean | — | Restricts input editing. |
enterKeyHint | "search" | "enter" | "done" | "go" | "next" | "previous" | "send" | — | Sets the label of the virtual keyboard's enter key on touch devices. |
focusOnClearClick | boolean | — | Specifies whether to focus the field when clear button is clicked. |
hideStatusSuffix | boolean | — | Specifies whether status suffix should be hidden. |
id | string | — | Assigns a unique identifier for the root element. |
inputmode | string | — | Sets the value of the native inputmode attribute, which tells mobile browsers which on-screen keyboard to show, for example numeric or email. |
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 such as use-mask-input. Memoize callback refs to avoid reattaching on every render. |
max | number | — | Sets a maximum value of an input. Similar to html5 max attribute. |
maxLength | number | — | Sets the maximum number of characters that can be inserted to a field. |
menuArrow | boolean | — | Specifies whether input should have a dropdown menu arrow on the right side. |
min | number | — | Sets a minimum value of an input. Similar to HTML5 min attribute. |
name | string | — | Reference element data when a form is submitted. |
noLeftBorderRadius | boolean | — | Specifies whether input shouldn't have rounded corners on its left. |
noRightBorderRadius | boolean | — | Specifies whether input shouldn't have rounded corners on its right. |
onBlur | FocusEventHandler | — | Defines a standard input onBlur callback. |
onChange | ChangeEventHandler | — | Defines a standard input onChange callback. |
onClear | (event: KeyboardEvent<HTMLButtonElement> | MouseEvent<HTMLButtonElement, MouseEvent>) => void | — | Displays clear button (X) on a non-empty input and calls a callback function. |
onCompositionChange | (isComposing: boolean) => void | — | Defines a callback function called on compositionstart/compositionend events. |
onCopy | ClipboardEventHandler<HTMLInputElement> | — | Defines a callback handler that is called when user copies text to a clipboard (using a mouse or keyboard shortcut) |
onEnterPressed | KeyboardEventHandler<HTMLInputElement> | — | Defines a callback handler that is called when the user presses -enter-. |
onEscapePressed | KeyboardEventHandler<HTMLInputElement> | — | Defines a callback handler that is called when the user presses -escape-. |
onFocus | FocusEventHandler | — | Defines a standard input onFocus callback. |
onInputClicked | MouseEventHandler | — | Defines a standard input onClick callback. |
onKeyDown | KeyboardEventHandler<HTMLInputElement> | — | Defines a standard input onKeyDown callback. |
onKeyUp | KeyboardEventHandler<HTMLInputElement> | — | Defines a standard input onKeyUp callback. |
onPaste | ClipboardEventHandler<HTMLInputElement> | — | Defines a callback handler that is called when user pastes text from a clipboard (using a mouse or keyboard shortcut) |
pattern | string | — | Sets a pattern that typed value must match to be valid (regex) |
placeholder | string | — | Sets a placeholder message to display. |
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: InputImperativeActions | null) => void | RefObject<InputImperativeActions> | — | 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). |
required | boolean | — | Specifies whether input is mandatory. |
role | string | — | Specifies the role of the input element for accessibility. |
rtl | boolean | — | Specifies text direction. If true, the text is displayed from right to left. |
size | "small" | "tiny" | "medium" | "large" | — | Controls the size of the input. Default value: medium |
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. |
statusMessageTooltipProps | TooltipCommonProps | — | Status message tooltip props. |
step | number | — | Specifies the interval between number values. |
suffix | ReactNode | — | Pass a component you want to show as the suffix of the input, e.g., text, icon. |
tabIndex | number | — | Indicates that element can be focused and where it participates in sequential keyboard navigation. |
textOverflow | "ellipsis" | "clip" | — | Handles text overflow behavior. It can either clip (default) or display ellipsis. |
tooltipPlacement | "right" | "left" | "top" | "bottom" | "auto" | "auto-start" | "auto-end" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-end" | "bottom-start" | "left-end" | "left-start" | — | Controls placement of a status tooltip. |
type | string | — | Specifies the type of <input/> element to display. Default is text. |
value | string | number | — | Specifies the current value of the element. |
withSelection | boolean | — |
Import the driver matching your test environment:
| Method | Description |
|---|---|
click | — |
getInputAttribute | — |
getInputElementClasses | — |
suffixComponentExists | — |
getRootElementClasses | — |
getAriaDescribedby | — |
getAriaLabel | — |
getName | — |
getMaxLength | — |
getType | — |
getAriaControls | — |
clickIconAffix | — |
clickCustomAffix | — |
getCustomAffixText | — |
hasSuffix | — |
getClearButtonTooltipContent | — |
prefixComponentExists | — |
hasPrefix | — |
hasClearButton | — |
clickClear | — |
getValue | — |
getText | — |
getPattern | — |
getPlaceholder | — |
isOfSize | — |
getSize | — |
isDisabled | — |
isHoveredStyle | — |
isFocusedStyle | — |
getRequired | — |
enterText | — |
getAutocomplete | — |
getDefaultValue | — |
getTabIndex | — |
isCustomInput | — |
getReadOnly | — |
getDisabled | — |
getTextOverflow | — |
focus | — |
blur | — |
keyUp | — |
keyDown | — |
pressKey | — |
paste | — |
copy | — |
wheel | — |
trigger | — |
isFocus | — |
clickMenuArrow | — |
hasMenuArrow | — |
isRTL | — |
getCursorLocation | — |
clearText | — |
clickOutside | — |
isMasked | — |
isSelected | — |
hasStatus | Return true if there's a status |
getStatusMessage | If there's a status message, returns its text value |
exists | Checks whether the component found with the given data hook. |
element | Gets the component root element. |
base | Returns UniDriver for the base element. |
inputmode prop now reaches the input, so NumberInput shows the numeric keyboard on mobile. GoogleAddressInput without a value now keeps typed text and shows address suggestions. (#17261)isDisabled driver testkit method (#15140)input DOM node via imperative handle (#14936)autoSelect and autoFocus behavior (#14406)Last updated: 26 October 2026