# Multiline button in perspective

**URL:** <https://forum.inductiveautomation.com/t/multiline-button-in-perspective/65632>\
**Category:** Ignition\
**Tags:** ignition79, ignition81, perspective\
**Created:** [October 25, 2022, 4:01am UTC](https://forum.inductiveautomation.com/t/multiline-button-in-perspective/65632 "2022-10-25T04:01:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![AGOSTINO\_SCLAUZERO](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@AGOSTINO\_SCLAUZERO](https://forum.inductiveautomation.com/u/AGOSTINO_SCLAUZERO)\
**Post date:** [October 25, 2022, 4:01am UTC](https://forum.inductiveautomation.com/t/multiline-button-in-perspective/65632/1 "2022-10-25T04:01:50Z")

</div>

Is it possible in perspective to have multiline buttons that allows you to decide where to break the line?  
I've got this:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/1/113c55f1bbb897bbcb36982ea3c9627d0ceb05a7.png)  
But I would like it to be like this:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/1/a160d9d0045d81036725c9d139e44fce12801b31.png)

In Vision this is achievable via html as in this official explanation: [https://inductiveuniversity.com/video/multi-line-labels-and-buttons/7.7](https://inductiveuniversity.com/video/multi-line-labels-and-buttons/7.7)

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.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [October 25, 2022, 5:05am UTC](https://forum.inductiveautomation.com/t/multiline-button-in-perspective/65632/2 "2022-10-25T05:05:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [October 25, 2022, 5:18am UTC](https://forum.inductiveautomation.com/t/multiline-button-in-perspective/65632/3 "2022-10-25T05:18:48Z")

</div>

Like @nminchin said: add the whitespace: pre style property:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/a/9aacedfd25b69ed235d53d52ab8b45690d0cc4bf.png)

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

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/4/64e8b5f2c2e7a8e0e603d7ce960bb29cd389e967.png)

This is the result:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/9/a951e4c5421e7cc527405451ca24444d95bb0335.png)

---

<div class="post-metadata">

**Author:** ![Eugene49](https://avatars.discourse-cdn.com/v4/letter/e/c6cbf5/32.png) [@Eugene49](https://forum.inductiveautomation.com/u/Eugene49)\
**Post date:** [December 18, 2024, 1:27am UTC](https://forum.inductiveautomation.com/t/multiline-button-in-perspective/65632/4 "2024-12-18T01:27:17Z")

</div>

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

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

---

<div class="post-metadata">

**Author:** ![Eugene49](https://avatars.discourse-cdn.com/v4/letter/e/c6cbf5/32.png) [@Eugene49](https://forum.inductiveautomation.com/u/Eugene49)\
**Post date:** [December 18, 2024, 5:18am UTC](https://forum.inductiveautomation.com/t/multiline-button-in-perspective/65632/5 "2024-12-18T05:18:15Z")

</div>

I got it.

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

```

Credit to google, stackoverflow

---

<div class="post-metadata">

**Author:** ![n099y](https://avatars.discourse-cdn.com/v4/letter/n/258eb7/32.png) [@n099y](https://forum.inductiveautomation.com/u/n099y)\
**Post date:** [February 5, 2026, 8:27pm UTC](https://forum.inductiveautomation.com/t/multiline-button-in-perspective/65632/6 "2026-02-05T20:27:03Z")

</div>

In 8.1 the style is no longer used, its textStyle:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/2/f2f91f78d399c73447db7f73f7b40f138d07f934.png)
