Skip to main content
Question

Trying to create a rectangle that resizes with text without the rectangle becoming a frame.

  • February 2, 2025
  • 3 replies
  • 89 views

hawkman5879

In Figma, how can I create a blurred rectangle behind a text box that expands dynamically as the text grows, while also being able to adjust the rectangle's transparency/effects separately from the text? I was trying to get chatgpt to help but it wasn’t working. Auto layout turns my rectangle into the frame which then has transparency and effects effect the text, which I don't want.

3 replies

Avokadomos
  • Active Member
  • 377 replies
  • February 2, 2025

You can use the background blur effect to avoid blurring content in the frame. If you can’t get the special effect that you want with just a frame, then add your rectangle in the same frame, but behind the text, and apply whatever effects you want to it. If the frame is an auto layout to adjust to the text size, then set the rectangle to ignore auto layout and make it scale with the frame using vertical and horizontal constraints.


hawkman5879
  • Author
  • New Member
  • 1 reply
  • February 2, 2025
Avokadomos wrote:

You can use the background blur effect to avoid blurring content in the frame. If you can’t get the special effect that you want with just a frame, then add your rectangle in the same frame, but behind the text, and apply whatever effects you want to it. If the frame is an auto layout to adjust to the text size, then set the rectangle to ignore auto layout and make it scale with the frame using vertical and horizontal constraints.

I don’t think this works for what I am trying to do. So what I want is a box behind text. This box should expand dynamically with the text. I also want to blur this box and change it’s transparency completely separately from the text. So my dilemna is that in order for the box to change with the text, they need to be in an auto layout together. But by doing this any effect given to the box is also given to the text.

 

This is the effect I want, but if I were to auto layout this, the rectangle would disappear and become a frame, making the blur effect cover the text as well. 


Avokadomos
  • Active Member
  • 377 replies
  • February 6, 2025

I see what you mean. It’s Figma trying to be smart and thinking you probably want that as a background. Try adding the rectangle after you’ve made the auto layout, and then set it to ignore auto layout.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings