Skip to main content
Solved

SOLVED: Differentiate vertical/horizontal item spacing values in REST API response for wrapping auto-layout frames


Simon_Steer

I noticed that auto-layout frames now support wrapping items to the next line, which is really great to see 🙂

Since users can now specify both vertical and horizontal item spacing values in wrapping auto-layout frames, this should be returned in API responses as well. Currently item spacing is represented as a single field, itemSpacing, which only takes into account spacing along the primary layout axis.

I propose adding a new field, counterAxisItemSpacing, or something similar, to represent spacing along the counter axis.

For the following example:
Screen Shot 2023-07-10 at 3.52.37 PM

The JSON response could look like this:

itemSpacing: 10,
counterAxisItemSpacing: 35

As far as I know this would be a non-breaking change to the API.

Cheers and thanks again for adding wrapping to auto-layout frames!

Best answer by tank666

The counterAxisSpacing property is responsible for this.
https://www.figma.com/developers/api#:~:text=auto-layout%20frames.-,counterAxisSpacing,-Number%20default%3A

View original

2 replies

tank666
  • 4858 replies
  • Answer
  • July 10, 2023

Simon_Steer

Ah, I see it now. Can’t believe I overlooked this! Thanks for the heads up.


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