How do can I place rectangle inside text variant?

I want to place text in front of the rectangle

when I try to place a rectangle inside It moves to the left and right side.

how can I replace this ??

maybe try to turn the text into an autolayout, and then use the auto layout as the rectangle