Components/Form
Interactive docs page: https://wix-pages.com/design-system-documentation/#/component/inputarea
Input areas let users insert long text values. The large size of the field indicates that a user is expected to insert at least a few sentences.
<Input/> instead.Adjust the size of the input using the size prop. It supports 2 sizes:
medium.small for more dense and compact layouts.Control the height of an area by defining a minimum or maximum number of pixels, or a certain number of rows.
minHeight and maxHeight.rows.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 component 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.disabledremoves all interactions and creates a disabled input state. Use it to highlight functions that are unavailable.Allow users to manually adjust the size of the input area by enabling theresizable prop.
Indicate how many characters the input area contains by enabling the hasCounter prop. To display a counter, specify the maxLength of characters allowed in the field.
Grow and shrink area size according to the input by enabling autoGrow. Specify the starting height of an area with minRowsAutoGrow.
Click to select/highlight all the text in the area with the autoSelect prop.
Component can be used in controlled mode by passing value and onChange props.
Auto grow feature does not work when component is used in controlled way which means using value and onChange properties. To force auto grow behaviour on state change just call ref method of component called calculateComputedRows which will recalculate rows on every value change.
Use input area when the user needs to enter multiple lines of text such as product descriptions and policies.
Use <FormField/> to provide a label for the field.
Use input area in settings panels to allow users to edit longer descriptions and titles.
| 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. |
autoFocus | boolean | — | Focus the element on mount (standard React input autoFocus). |
autoGrow | boolean | — | Specifies whether area should grow and shrink according to user input. |
autoSelect | boolean | — | Automatically selects the entire input text. |
backgroundColor | string | — | Sets the background color of the input area. Accepts any CSS color value. |
children | InputAreaChildrenFnArgs | — | Specifies custom textarea render function. |
dataHook | string | — | Applies a data-hook HTML attribute that can be used in the tests. |
defaultValue | string | — | Sets a default value for those who want to use this component un-controlled. |
dir | "rtl" | "auto" | "ltr" | — | Specifies the text direction. Use "auto" to automatically determine direction based on content. |
disabled | boolean | — | Specifies whether input should be disabled. |
enterKeyHint | "search" | "enter" | "done" | "go" | "next" | "previous" | "send" | — | Sets the label of the virtual keyboard's enter key on touch devices. |
hasCounter | boolean | — | Specifies whether character count is enabled. |
id | string | — | Assigns an unique identifier for the root element. |
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. |
maxHeight | string | — | Sets the maximum height of an area in pixels. |
maxLength | number | — | Defines the maximum text length in number of characters. |
maxRowsAutoGrow | number | — | Sets the maximum amount of rows the component can have in autoGrow mode. |
menuArrow | boolean | — | Specifies whether input should have a dropdown menu arrow on the right side. |
minHeight | string | — | Sets the minimum height of an area in pixels. |
minLength | number | — | Defines the minimum text length in number of characters. |
minRowsAutoGrow | number | 2 | Sets the minimum amount of rows the component can have in autoGrow mode. |
name | string | — | Reference element data when a form is submitted. |
onBlur | FocusEventHandler | — | Defines a standard input onBlur callback. |
onChange | ChangeEventHandler | — | Defines a standard input onChange callback. |
onCompositionEnd | (event: CompositionEvent<HTMLTextAreaElement>) => void | — | Defines a standard input onCompositionEnd callback. |
onCompositionStart | (event: CompositionEvent<HTMLTextAreaElement>) => void | — | Defines a standard input onCompositionStart callback. |
onEnterPressed | KeyboardEventHandler<HTMLTextAreaElement> | — | Defines a callback handler that is called when user presses enter. |
onEscapePressed | () => void | — | Defines a callback handler that is called when user presses escape. |
onFocus | (e?: FocusEvent<HTMLTextAreaElement, Element> | undefined) => void | — | Defines a standard input onFocus callback. |
onKeyDown | KeyboardEventHandler<HTMLTextAreaElement> | — | Defines a standard input onKeyDown callback. |
onKeyUp | KeyboardEventHandler<HTMLTextAreaElement> | — | Defines a standard input onKeyUp callback. |
placeholder | string | — | Sets a placeholder message to display. |
readOnly | boolean | — | Specifies whether input is read only. |
ref | null | string | (instance: InputAreaComponent | null) => void | RefObject<InputAreaComponent> | — | 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 the input area is a mandatory field. |
resizable | boolean | — | Specifies whether area can be manually resized by the user. |
rows | number | — | Sets initial height of an area to fit a specified number of rows. |
size | "small" | "medium" | — | Controls the size of the input. |
status | "error" | "warning" | "loading" | — | Specifies 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. |
tabIndex | number | — | Indicates that element can be focused and where it participates in sequential keyboard navigation. |
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. |
value | string | — | Defines input value. |
Import the driver matching your test environment:
| Method | Description |
|---|---|
trigger | — |
focus | — |
enterText | — |
getValue | — |
getName | — |
getPlaceholder | — |
getDefaultValue | — |
getRowsCount | — |
getMaxLength | — |
getMinLength | — |
getTabIndex | — |
getReadOnly | — |
getCursorLocation | — |
getResizable | — |
getDisabled | — |
getRequired | — |
getHasCounter | — |
getCounterValue | — |
hasExclamation | — |
isFocusedStyle | — |
isSizeSmall | — |
isHoveredStyle | — |
isFocus | — |
exists | — |
getStyle | — |
getAriaLabel | — |
getAriaControls | — |
getAriaDescribedby | — |
getTooltipDataHook | — |
getTooltipElement | — |
hasStatus | Return true if there's a status |
getStatusMessage | If there's a status message, returns its text value |
element | Gets the component root element. |
click | Clicks on the component root element. |
base | Returns UniDriver for the base element. |
Input of the same size in every theme, so autoGrow and one-row fields line up with inputs next to them. Harmony (odeditor), Studio 2.0 (odeditor-dark) and Studio 2.0 Light (studio2-light) InputAreas get 4px shorter, Wixel 2px shorter at medium. (#17198) — has visual changesInputAreaState type is now exported, so apps that wrap and re-export InputArea no longer fail their own declaration (.d.ts) builds with TS4023. (#16846)InputArea type export used for typing refs (e.g. useRef<InputArea>(null)), which was lost when the component was wrapped with withDefaultProps. (#16821)maxRowsAutoGrow prop (#14078)calculateComputedRows API method (#13315)Last updated: 26 October 2026