How to set vertical gap between row

I’ve set itemSpacing = 16; in my Figma plugin, but it seems to only affect the horizontal spacing. How can I apply this spacing vertically between rows as well?

    ....
    styleGroupFrame.name = 'Pantone';
    styleGroupFrame.layoutMode = 'HORIZONTAL';
    styleGroupFrame.itemSpacing = 16;
    styleGroupFrame.fills = [];
    styleGroupFrame.primaryAxisSizingMode = 'FIXED'; 
    styleGroupFrame.counterAxisSizingMode = 'AUTO'; 
    styleGroupFrame.layoutWrap = 'WRAP';
    styleGroupFrame.layoutAlign = 'STRETCH'; 
    ...

The result look like this

You can find all Auto Layout properties here: FrameNode | Plugin API

The property you are looking for is right after the itemSpacing: it is counterAxisSpacing. :slight_smile:

1 Like