Text Area

A text area to enter multiple lines of text. It can perform validation of required field, minimum or maximum length, and custom rules.

Text Area can scale with content or remain a fixed size, and automatically capitalize or check spelling.

Properties

Available properties for Text Area with supported data types or values. You can write JavaScript almost anywhere in Retool to manipulate or read information about components.

NameTypeDescriptionvaluestring

The current value.

autoCapitalize'none' | 'sentences' | 'words' | 'characters'

Whether the browser can automatically capitalize text in the input field when using virtual or on-screen keyboards.

autoCompleteboolean

Whether the browser can perform autocomplete on the input field.

autoFillstring

The data type of the input field for browsers to autofill if autoComplete is true.

autoResizeboolean

Whether the input field expands to accommodate larger amounts of content.

disabledboolean

Whether user input, interaction, or selection is disabled.

formDataKeystring

The key used by a Form component to assign default values to input fields using form.initialData, and to construct the form.data property.

hiddenboolean

Whether the component is visible.

hideValidationMessageboolean

Whether to hide the validation message if the invalid is true.

inputTooltipstring

The tooltip text to display below the input field on focus.

invalidboolean

Whether the current value has failed any validation rules.

labelstring

The text to display as a label for the input field.

labelAlign'left' | 'right'

The horizontal alignment of the label.

labelCaptionstring

The additional text to display with the label.

labelPosition'left' | 'top'

The position of the label relative to the input field.

labelWidthnumber

The label width, in the unit specified in labelWidthUnit.

labelWidthUnit'%' | 'px' | 'col'

The specified units for labelWidth.

labelWrapboolean

Whether the label can wrap to multiple lines.

loadingboolean

Whether to display a loading indicator.

maintainSpaceWhenHiddenboolean

Whether the component takes up space on the canvas if hidden is true.

marginstring

The amount of margin to render outside of the component.

maxLengthnumber | null

The maximum number of characters to allow.

maxLinesnumber | null

The maximum number of lines of text to display if autoResize is true.

minLengthnumber | null

The minimum number of characters to allow.

minLinesnumber

The minimum number of lines to display.

patternstring

A JavaScript regular expression, without forward slashes around the pattern, to validate input if patternType is regex.`

placeholderstring

The text to display in the input field when empty.

readOnlyboolean

Whether the value is read only and cannot be modified.

requiredboolean

Whether the input is required for validation.

showCharacterCountboolean

Whether to display a character count with the input field.

showInEditorboolean

Whether the component remains visible in the editor if hidden is true.

spellCheckboolean

Whether the browser can perform spellcheck on the input field.

tooltipTextstring

The text to display in a tooltip on hover or focus.

validationMessagestring

The validation message to display if the input is invalid.

Events

Events are triggered by user interactions with Text Area. Use event handling to trigger queries or other actions in response to events.

NameDescriptionChange

A user changes the current value.

Focus

A user selects the input field.

Blur

A user deselects the input field.

Methods

Methods for interacting with Text Area. You can write JavaScript almost anywhere in Retool and use methods to manipulate data or components.

NameDescriptionsetValue(value: boolean | string | number | void)

Set the current value.

clearValue()

Clear the current value.

scrollIntoView(options: any)

Scrolls the canvas or parent container so that the selected component appears in the visible area.

validate()

Validates the value of the input field.

clearValidation()

Clear the validation message from the input field.

setHidden(hidden: boolean)

Set the hidden value to toggle whether the component is visible. Defaults to true without a parameter.

setDisabled(disabled: boolean)

Set the disabled value to toggle whether the input field is disabled. Defaults to true without a parameter.

resetValue()

Reset value to the default value.

focus()

Set focus on the input field.

Related components