Limit Paragraph string length or prevent wrapping?

Can I limit the length of the Paragraph text or prevent it from wrapping?

I’d like to use the component as a header and any string longer than a set size I’d like to cut.

image

I can’t find any way to limit the length of these strings. Is this possible?

You have a few options.

  1. Set the height or max height on the style tab of the paragraph component to the same value as the line height (in typography setting). This will simply make the component 1 line in height and hide the text that extends past the first line.

  2. Use the formula binding for the Content property of the paragraph component and use the Truncate function (in the Text subsection of the formulas). This will truncate the text to whatever number of characters you want to allow. It may not be optimal, because it adds the “…” at the end letting the user know what there is more text that isn’t shown.

  3. You could also use the SUBSTRING formula (in the Text subsection of the formulas). It will allow you to select a subset of the characters from the string. You can select the subset from anywhere in the string, but I am assuming you will want it from the beginning of the string to a certain number of characters in.

2 Likes