InputArea

Components/Form

Interactive docs page: https://wix-pages.com/design-system-documentation/#/component/inputarea

Overview

Copy

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.

Do

  • Use it to insert multiple lines of text.

Don't

  • Don't use it to insert short text values. Use <Input/> instead.

Feature examples

Size

Adjust the size of the input using the size prop. It supports 2 sizes:

  • For most common cases, use the default medium.
  • Use small for more dense and compact layouts.
Copy

Height

Control the height of an area by defining a minimum or maximum number of pixels, or a certain number of rows.

  • To define the minimum and maximum height in pixels, use minHeight and maxHeight.
  • Define the height of a specified number of rows with rows.
Copy

Status

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.
Copy

Status message

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.

  • To add an accessible inline message, wrap the component in a <FormField/> and add the statusMessage.
  • To add a status message in a tooltip that requires users to hover on the icon, use the statusMessage prop. Control tooltip placement with tooltipPlacement prop.

View more inline status message examples in <FormField/>.

Copy

Read-only and disabled

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.
Copy

Resize

Allow users to manually adjust the size of the input area by enabling theresizable prop.

Copy

Character count

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.

Copy

Auto grow

Grow and shrink area size according to the input by enabling autoGrow. Specify the starting height of an area with minRowsAutoGrow.

Copy

Auto select

Click to select/highlight all the text in the area with the autoSelect prop.

Copy

Developer examples

Controlled

Component can be used in controlled mode by passing value and onChange props.

Copy

Force autogrow when controlled externally

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.

Copy

Common use case examples

Forms

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.

Copy

Settings panel

Use input area in settings panels to allow users to edit longer descriptions and titles.

Copy

Code

Copy

Props

NameTypeDefaultDescription
ariaControlsstring—Associate a control with the regions that it controls.
ariaDescribedbystring—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.
ariaLabelstring—Define a string that labels the current element in case where a text label isn't visible on the screen.
autoFocusboolean—Focus the element on mount (standard React input autoFocus).
autoGrowboolean—Specifies whether area should grow and shrink according to user input.
autoSelectboolean—Automatically selects the entire input text.
backgroundColorstring—Sets the background color of the input area. Accepts any CSS color value.
childrenInputAreaChildrenFnArgs—Specifies custom textarea render function.
dataHookstring—Applies a data-hook HTML attribute that can be used in the tests.
defaultValuestring—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.
disabledboolean—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.
hasCounterboolean—Specifies whether character count is enabled.
idstring—Assigns an unique identifier for the root element.
inputmodestring—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.
maxHeightstring—Sets the maximum height of an area in pixels.
maxLengthnumber—Defines the maximum text length in number of characters.
maxRowsAutoGrownumber—Sets the maximum amount of rows the component can have in autoGrow mode.
menuArrowboolean—Specifies whether input should have a dropdown menu arrow on the right side.
minHeightstring—Sets the minimum height of an area in pixels.
minLengthnumber—Defines the minimum text length in number of characters.
minRowsAutoGrownumber2Sets the minimum amount of rows the component can have in autoGrow mode.
namestring—Reference element data when a form is submitted.
onBlurFocusEventHandler—Defines a standard input onBlur callback.
onChangeChangeEventHandler—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.
onEnterPressedKeyboardEventHandler<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.
onKeyDownKeyboardEventHandler<HTMLTextAreaElement>—Defines a standard input onKeyDown callback.
onKeyUpKeyboardEventHandler<HTMLTextAreaElement>—Defines a standard input onKeyUp callback.
placeholderstring—Sets a placeholder message to display.
readOnlyboolean—Specifies whether input is read only.
refnull | 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).
requiredboolean—Specifies whether the input area is a mandatory field.
resizableboolean—Specifies whether area can be manually resized by the user.
rowsnumber—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.
statusMessageReactNode—Defines the message to display on status icon hover. If not given or empty, no tooltip is displayed.
tabIndexnumber—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.
valuestring—Defines input value.

Testkit

Import the driver matching your test environment:

Copy

Driver methods

MethodDescription
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—
hasStatusReturn true if there's a status
getStatusMessageIf there's a status message, returns its text value
elementGets the component root element.
clickClicks on the component root element.
baseReturns UniDriver for the base element.

Changelog

  • 1.340.0 (2026-10-21) — maintenance release, no component-specific changes
  • 1.339.0 (2026-10-19) — maintenance release, no component-specific changes
  • 1.338.0 (2026-10-15) — maintenance release, no component-specific changes
  • 1.331.0 (2026-10-01) — maintenance release, no component-specific changes
  • 1.330.3 (2026-09-29) — maintenance release, no component-specific changes
  • 1.330.0 (2026-09-28) — breaking: a single line is now exactly as tall as 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 changes
  • 1.329.0 (2026-09-24) — maintenance release, no component-specific changes
  • 1.328.0 (2026-09-22) — maintenance release, no component-specific changes
  • 1.326.0 (2026-09-17) — maintenance release, no component-specific changes
  • 1.325.0 (2026-09-17) — maintenance release, no component-specific changes
  • 1.323.0 (2026-09-10) — maintenance release, no component-specific changes
  • 1.314.0 (2026-08-19) — fix: the InputAreaState type is now exported, so apps that wrap and re-export InputArea no longer fail their own declaration (.d.ts) builds with TS4023. (#16846)
  • 1.313.1 (2026-08-18) — fix: restored the InputArea type export used for typing refs (e.g. useRef<InputArea>(null)), which was lost when the component was wrapped with withDefaultProps. (#16821)
  • 1.312.0 (2026-08-14) — maintenance release, no component-specific changes
  • 1.310.0 (2026-08-10) — maintenance release, no component-specific changes
  • 1.295.0 (2026-07-03) — maintenance release, no component-specific changes
  • 1.292.0 (2026-06-22) — maintenance release, no component-specific changes
  • 1.291.0 (2026-06-19) — maintenance release, no component-specific changes
  • 1.278.0 (2026-05-08) — maintenance release, no component-specific changes
  • 1.273.0 (2026-04-30) — maintenance release, no component-specific changes
  • 1.272.0 (2026-04-27) — maintenance release, no component-specific changes
  • 1.270.0 (2026-04-20) — fix: added css property to manage overscroll behaviour (#16159)
  • 1.266.0 (2026-04-07) — maintenance release, no component-specific changes
  • 1.260.0 (2026-03-17) — maintenance release, no component-specific changes
  • 1.253.0 (2026-01-30) — feat: add minLength to InputArea (#15881)
  • 1.252.0 (2026-01-28) — fix: harmony dark extra row issue fixed (#15879)
  • 1.247.2 (2026-01-21) — maintenance release, no component-specific changes
  • 1.232.0 (2025-11-28) — maintenance release, no component-specific changes
  • 1.213.0 (2025-08-19) — maintenance release, no component-specific changes
  • 1.212.0 (2025-08-11) — maintenance release, no component-specific changes
  • 1.207.0 (2025-07-24) — maintenance release, no component-specific changes
  • 1.203.0 (2025-07-01) — fix: tokenize InputArea placeholder (#15021)
  • 1.203.0 (2025-07-01) — feat: added dir prop (#15029)
  • 1.198.3 (2025-06-10) — maintenance release, no component-specific changes
  • 1.183.0 (2025-04-24) — fix: rename semantic class name (#14792)
  • 1.175.1 (2025-04-01) — maintenance release, no component-specific changes
  • 1.172.1 (2025-03-21) — maintenance release, no component-specific changes
  • 1.166.0 (2025-03-04) — feat: expose onCompositionStart/onCompositionEnd (#14577)
  • 1.165.0 (2025-02-27) — maintenance release, no component-specific changes
  • 1.138.1 (2024-10-30) — maintenance release, no component-specific changes
  • 1.129.0 (2024-09-25) — maintenance release, no component-specific changes
  • 1.124.0 (2024-09-06) — feat: add maxRowsAutoGrow prop (#14078)
  • 1.115.0 (2024-07-17) — maintenance release, no component-specific changes
  • 1.114.0 (2024-07-11) — maintenance release, no component-specific changes
  • 1.109.2 (2024-06-17) — maintenance release, no component-specific changes
  • 1.102.0 (2024-04-16) — maintenance release, no component-specific changes
  • 1.94.0 (2024-02-14) — feat: expose calculateComputedRows API method (#13315)
  • 1.92.1 (2024-02-05) — maintenance release, no component-specific changes

Last updated: 26 October 2026

Did this help?