# Border Width on a Perspective button

**URL:** <https://forum.inductiveautomation.com/t/border-width-on-a-perspective-button/107481>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [June 17, 2025, 3:24pm UTC](https://forum.inductiveautomation.com/t/border-width-on-a-perspective-button/107481 "2025-06-17T15:24:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sweetz](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@Sweetz](https://forum.inductiveautomation.com/u/Sweetz)\
**Post date:** [June 17, 2025, 3:24pm UTC](https://forum.inductiveautomation.com/t/border-width-on-a-perspective-button/107481/1 "2025-06-17T15:24:59Z")

</div>

Hello,

I have a Perspective screen with several buttons with constant text field like 1,2 etc. (which display part details when clicked) and also a custom prop associated with each button to change border width when I click a button which runs a script bound to the custom prop. However, it doesn't really change the width when I switch between buttons. Not sure what's going on here. Attaching some pics here. I have inherited this project and know just basics on Ignition. PLease help.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/4/44971935bd0b8db249096ec1b5f3df5531ccd473.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/7/b7aa05036d54b253b74a897645566d90db515b94.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/5/1520e0eeb1b7c4e2939ceaec99018e5024e5abd5.png)

---

<div class="post-metadata">

**Author:** ![Ryan\_Deardorff](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan_deardorff/32/63815_2.png) [@Ryan\_Deardorff](https://forum.inductiveautomation.com/u/Ryan_Deardorff)\
**Post date:** [June 17, 2025, 3:39pm UTC](https://forum.inductiveautomation.com/t/border-width-on-a-perspective-button/107481/2 "2025-06-17T15:39:17Z")

</div>

Not sure why that isn't working, but I wouldn't use a script for this kind of thing. I would bind an Expression directly on the style properties themselves. Something like:

```python
if({this.custom.border} = {this.props.text},
	5,
	1
)

```

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [June 17, 2025, 3:53pm UTC](https://forum.inductiveautomation.com/t/border-width-on-a-perspective-button/107481/3 "2025-06-17T15:53:37Z")

</div>

Try with a unit: `"1px"`, `"5px"` for example.  
Also, as Ryan said, use a binding.  
In fact, whenever you find yourself thinking "I know, I'll use a value change script !", you should first try with a binding.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [June 17, 2025, 4:32pm UTC](https://forum.inductiveautomation.com/t/border-width-on-a-perspective-button/107481/4 "2025-06-17T16:32:48Z")

</div>

> [@Sweetz](#):
>
> ... when I switch between buttons.

This sounds like a job for the [Perspective - Multi-State Button | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/appendix/components/perspective-components/perspective-input-palette/perspective-multistate-button). It has a `selectedStyle` property which means that you don't need any script or binding.

![Multistate button border](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/1/a16ba6f461550208f7044d68c6e92fdb828b5dec.gif)

_No code!_

Tip: use [Perspective Built-In Themes | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/ignition-modules/perspective/styles/perspective-built-in-themes#built-in-theme-colors) or define your own instead of hard-coding them into properties. Its the way of the web.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [June 17, 2025, 5:37pm UTC](https://forum.inductiveautomation.com/t/border-width-on-a-perspective-button/107481/5 "2025-06-17T17:37:28Z")

</div>

Good catch.

---

<div class="post-metadata">

**Author:** ![Sweetz](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@Sweetz](https://forum.inductiveautomation.com/u/Sweetz)\
**Post date:** [June 18, 2025, 1:04pm UTC](https://forum.inductiveautomation.com/t/border-width-on-a-perspective-button/107481/6 "2025-06-18T13:04:38Z")

</div>

Thanks for the responses! I will try these options

---

<div class="post-metadata">

**Author:** ![Sweetz](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@Sweetz](https://forum.inductiveautomation.com/u/Sweetz)\
**Post date:** [June 23, 2025, 1:53pm UTC](https://forum.inductiveautomation.com/t/border-width-on-a-perspective-button/107481/7 "2025-06-23T13:53:29Z")

</div>

Update: Without having to change much, I just added 'px' to the width numbers as mentioned by pascal.fragnoud and it worked. Thank you again
