Updated: December 19, 2016

Text

sap.m.Text

Intro

The text control is used to display text. It generally contains the text that developers want apps to display (property: text).

Text used within a form
Text used within a form

Usage

Use the text control if you want to display text inside a form, table, or any other content area. However, do not use this control together with labels.

Responsiveness

The text control is fully adaptive to all screen sizes. You can also set a specific width and overwrite the default value. The resizing behavior depends on the settings that the apps use for the text.

Properties

You can define whether the text should wrap or directly truncate (property: wrapping).

You can also define how often the text should wrap before it truncates (property: maxLines).

 

Note: The truncation indicator for multiple lines depends on the browser line clamping support. For browsers that support it, this will be shown as an ellipsis (…), whereas in other browsers, the overflowing text will just be cut off.

Text – Maximum line examples
Text – Maximum line examples

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

  • Text (SAPUI5 samples)
  • Text (SAPUI5 API reference)