Skip to main content
cb-torpedo
New Member
January 8, 2024
Question

Dynamically reduce text font size or scale to fit parent container?

  • January 8, 2024
  • 21 replies
  • 43165 views
  • I need a single line of text to fit within a container without wrapping, breaking the boundary, or truncating.
  • I need the text to get smaller when it gets too long to fit, either by reducing font size or overall scale.
  • The text is dynamic, so I can’t reliably tell how long it will be to pick an ideal font size.

Things I’ve tried:

  • Standard left and right with top and bottom constraints, but if the text becomes too long, it wraps and breaks the boundary or truncates.
  • Using text auto width with scale constraints, but the text just grows outside the boundary.
  • Using text auto width then wrapping it with an auto layout, thinking the layout could hug the text and use scale constraints to get smaller, but hug resizing and scale constraints are mutually exclusive.

Is there any way to do this dynamically?

21 replies

irvin
New Member
April 21, 2026

Hi.

I don’t think you can dynamically scale the font size of a Text element in Figma by changing/scaling the size of it’s parent layer, or maybe not yet, or maybe I am wrong.

What you can do if you want your text to a single line and fits the container without wrapping, breaking the boundary, or truncating the text is by using this technique:

  1. Through Auto-layout - Set the text element to auto-width and the auto-layout container to hug. The container will just adjust it’s width depending on the length of the text layer without wrapping or breaking it but the problem is you won’t be able to adjust it’s width or length manually else the hug properties will be removed and become fixed.

     

  2. Scale - If you want to manually scale the container where the text will also scale dynamically, you can use the scale tool in Figma. You can find it on the tools menu on the upper left corner of the app.
    image

This works