Intro

The text area is an input control that allows the user to enter multiple lines of text.

Usage

Use the text area if you want to enter multiple lines of text. If you only want to enter a single line of text, use the text control instead.

Responsiveness

You can set the maximum number of lines to be shown. The amount of text depends on the size of the screen. On smaller screens, the user can scroll down the text area to see the entire text. To indicate that the text continues, the control shows only half of the last line. This also applies for mobile devices.

Components

The text area allows the user to enter multiple lines of text.

Text area – Default

Text area – Default

Text area – Active state

Text area – Active state

You can also set a placeholder (input prompt), which is inherited from sap.m.InputBase; property: placeholder. The prompt text is displayed when the input field is empty.

Text area – With placeholder (input prompt)

Text area – With placeholder (input prompt)

Behavior and Interaction

Entering and Removing Text

The user can enter text. As soon as the user starts typing, the placeholder disappears. It appears again when the user removes all the content from the text area.

You can also limit the number of characters a user can enter. In this case, the text area prevents the user from adding more characters than the maximum value defined (property: maxLength).

Text area – Limited

Text area – Limited

Making Text Non-Editable

You can set the text area to non-editable (property: editable). This mode still allows the user to scroll to the text that is currently hidden.

Text area – Not editable

Text area – Not editable

Disabling Text

You can also set the text area to disabled. In this case, the user cannot edit or scroll (property: enabled).

Text area – Not enabled

Text area – Not enabled

Text area – Not enabled (long text)

Text area – Not enabled (long text)

information
For information on how to manage leading and treading whitespace (blanks) when copying and pasting text into input controls, please see removing leading and trailing whitespace.

Styles

As with any other input control, you can validate the fields and show the result as a value state (property: valueState) of the control (such as error, warning, success, or none).

For more information, see form field validation.

Text area – Error state

Text area – Error state

Guidelines

Properties

Resources

Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.

Elements and Controls

Implementation

Visual Design

  • Text Area (visual design specification)
  • Form (visual design specification)