Skip to main content
Cody_Porter
New Member
January 22, 2021

LAUNCHED: Min and Max Width for Auto Layout

  • January 22, 2021
  • 95 replies
  • 65553 views

I would like to add a max-width to a text box while using auto layout to keep the word count per line at a reasonable minimum.

Currently, I have the text element set to “Fill Container” which makes the text respond very nicely to the screen size. But because it is set to “Fill Container”, the text spans the entire width of the element which makes the text lines more difficult for users to read quickly.

If a max-width was set, the component should respond until it reaches the max-width, which would help keep the line length down.

I also feel like there are many other circumstances where max and min-width would be extremely helpful

Anyone else having this issue? Or does anyone have a great fix/hack to get around it?

Looking forward to seeing what you have to say.

Cheers,

95 replies

Alex_Wright
March 24, 2022

Yes That’s my exact use case for why I need it, too!

Oluwadamilare
April 27, 2022

I am still having trouble with setting min-width for buttons. The option of including an hidden line works but doesn’t work when I include an icon. Who can help?

Vincent21
April 27, 2022

I am still having trouble with setting min-width for buttons. The option of including an hidden line works but doesn’t work when I include an icon. Who can help?

Remy1
May 20, 2022

+1 how to use auto-layout without max-width?

Daniel_Lewandowski1
June 9, 2022

+!,000,000 PLEASE! This is a critical feature and hope it’ll be added soon.

Michael_Vogl
June 15, 2022

It appears this workaround does not work anymore… I, like others can still resize beyond the min size limit. Even in the demo files.

Camila_Grizio
June 17, 2022

What I do to define max-widths is create a component for the element (e.g., a container with text inside). In the component, I define a fixed width (e.g. 1100px), which will play as my max-width.
Then, I use instances of that component in the screen I’m working on and, depending on the frame size I’m using, I switch from “fixed width” (it will have the same width as the one I set in the component, which would be the max-width) to “fill container” (for frames that have a smaller size than the max-width).

Katherine_Hajer
July 12, 2022

I need to have buttons expand (and reduce padding to a certain minimum) if their label is longer than usual, but if the label is shorter than usual, they need to retain a certain minimum width (all while keeping the label centred).

I’ve tried a bunch of different ways to do this, and none of them are working. It’s a big concern because I don’t want the team members to keep fussing with Auto-Layout settings (the whole idea is to make this easy for everyone, not harder).

+1 for this feature, all the way.

Stuart_Tett
August 2, 2022

Another +1 for this feature. IMO a big missing part of auto-layout. For now I think I’ll just use another variant for the max-width

Christian_Heydt
August 10, 2022

+1
This would be a very handy feature.