Multiline button in perspective

Is it possible in perspective to have multiline buttons that allows you to decide where to break the line?
I've got this:
image
But I would like it to be like this:
image

In Vision this is achievable via html as in this official explanation: Multi-Line Labels and Buttons - Understanding Components

I couldn't find a similar solution for perspective too.

In the example I used the padding to force it to break the line, obviosly a tricky solution that can stop working any time as the layout is adjusted.

It's a bit so-so, but make your property window narrow enough for the text prop of the button to show the ellipsis (...) and then you can add line breaks in there. You'll then also need to add the style.whiteSpace: pre style as well

2 Likes

Like @nminchin said: add the whitespace: pre style property:
image

Then add the following expression binding to the text prop:
'Load data\n(from XML)'

image

This is the result:
image

8 Likes

What if the source text comes from custom parameter and is passed to the button?

for instance:
custom parameter: "Load data\n(from XML)"

I got it.

return value.replace('\\n', '\n')

Credit to google, stackoverflow