Skip to main content
Kerstin_Stepper
Jul 25, 2023 10:19 AM UTC
Question

Is there auto layout wrap "vertical first"?

The awesome new auto layout! Thanks Figma <3
My topic: The wrap feature does always fill the available width, before adding a second row.
I’m looking for the setting how to fill the possible height first, before adding a new column.

In the screenshot you can see the fifth item will always align top right instead of below-right.
Bildschirmfoto 2023-07-25 um 12.17.16
Is there a setting to choose “vertical first” instead of “horizontal first”?

Best, Kerstin

    This topic has been closed for replies.

    13 replies

    Josh
    Former Community Manager
    Jul 25, 2023 9:25 PM UTC

    Would setting a max width here help?

    Josh
    Former Community Manager
    Jul 25, 2023 9:30 PM UTC

    Here’s an example. I’ve got the max width set to 168 which is the width of the 2 elements + spacing. Then as you add elements they wrap vertically instead of creating a 3rd column.


    The preview though in the auto layout properties panel still shows it wrapping to a 3rd column. This is is just fixed icon to signify that wrapping is turned on.

    Hope this helps! 😊

    Kerstin_Stepper
    Jul 26, 2023 8:44 AM UTC

    Hey,
    thanks for your quick answer!

    Unfortunately setting a max-width doesn’t solve it.
    In my example I have max. 4 items. If I all 4 are visible, they arrange as a grid. If there’re 3 visible, the third aligns beneath; thats correct. The thing is: If there’re only 2 visible, they do align horizontally. But I want them to align vertically, filling the max available height.

    Haroll
    Figma Ambassador
    Figma Ambassador
    Jul 26, 2023 8:52 AM UTC

    Hello @Kerstin_Stepper

    I would not recommend to do this but it helped me when I encounter the same problem as you.
    My solution was to tricks the system by rotating the auto-layout with a -90 angle and to reset the rotation parameter of the elements inside it, in order for the auto layout to fill by its height before its width

    Hope it helped!

    Figma’s Forum Ambassador
    Kerstin_Stepper
    Jul 26, 2023 8:55 AM UTC

    I did a use a workaround now: using two columns – Just like before wrap feature did exist 😉

    Kerstin_Stepper
    Jul 26, 2023 9:00 AM UTC

    Next thing is:
    The order is different; see in my example below.

    Kerstin_Stepper
    Jul 26, 2023 9:02 AM UTC

    It’s impossible to make this item order with auto layout wrap.
    Thats why I used the columns workaround.

    Haroll
    Figma Ambassador
    Figma Ambassador
    Jul 26, 2023 10:53 AM UTC

    Well it’s not impossible, but it’s a trick:

    1. make an auto-layout with wrap
    2. rotate parent by -90deg
    3. flip parent horizontally (shift+H)
    4. rotate children by 0deg
    5. flip children vertically (shift+V)

    Figma’s Forum Ambassador
    Avokadomos
    Figma Ambassador
    Figma Ambassador
    Jul 26, 2023 11:07 AM UTC

    Here’s an example that utilizes the same method that @Haroll mentioned:

    Disclosure: I’m part of Figma’s Forum Ambassador program.
    Greg_Huntoon1
    Nov 1, 2023 7:22 PM UTC

    Yes, wanting the exact same. This example on Stackoverflow shows the request pretty well.