Best way to dynamically add horizontal space to custom component?

Instead of using a spacer I use a label, set its role to text and add a number of spaces.

Setting its role to text prevents adjacent spaces from being squished into one space.

You can see the result here.

1 Like