Skip to main content
Solved

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

  • July 10, 2023
  • 2 replies
  • 679 views

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

This topic has been closed for replies.

2 replies

tank666
  • 4873 replies
  • Answer
  • July 10, 2023

Simon_Steer
  • Author
  • 27 replies
  • July 10, 2023

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