Wrapping and Truncating Text

Intro

Wrapping and truncation define how text behaves when the length of the text exceeds the available space. The responsive behavior is device-independent and is the same on all form factors. Different controls make use of wrapping and/or truncation. This article provides an overview of best practices.

Types

There are three types of responsive behavior for text that doesn’t fit onto a line:

Wrapping

Excess text moves down to the next line.

Note: If you switch on hyphenation, there is always a minimum of 3 characters at the end of the line before wrapping and at the start of the next line after wrapping.

Text wraps

Text wraps

Truncation

Excess text is cut off and is no longer visible. A truncation indicator appears at the end of the line (…).

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

Text truncates

Text truncates

Wrapping and Truncation

Wrapping and truncation are combined. For example, a text might wrap over two lines and then truncate.

Combination: The text wraps over three lines and then truncates

Combination: The text wraps over three lines and then truncates

Usage

Follow the best practices below to decide whether to use truncation, wrapping, or a combination of both for your use case.

Use wrapping if:

Use truncation if:

Use a combination of wrapping and truncation if:

Do not use wrapping, truncation, or the combination of both techniques if:

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

No links

Visual Design

No links