Auto Layout: Build Responsive Stacks in Figpea

Auto layout turns a group into a stack that re-packs its children for you. Pick a direction and the children line up along it; set a gap and padding and they stay evenly spaced; change alignment or switch a side to hug its contents and the group frame shrinks to fit. It all runs in your browser — nothing is uploaded.

Where the controls live

The Auto layout section appears in the right-hand design panel only when a single group is selected. It mirrors the existing Constraints and Boolean section vocabulary: a direction toggle, a Gap field, a linked four-side Padding control, Primary and Counter axis alignment, and Sizing. (If you have a shape, a page, or several layers selected, the section stays hidden — it is a group-only control.)

Turn a group into a stack

Set direction to None, Horizontal, or Vertical. Applying a direction adopts the children's current visual order and re-packs them immediately; one undo restores the free arrangement. The re-pack happens in place — the group stays where you put it, and hug growth extends outward from that same frame.

Setting a group to Vertical auto layout and watching its children re-pack top to bottom

Enabling Vertical auto layout on a group parked away from the canvas origin: the children re-pack top to bottom while the outer frame stays exactly where it was placed

The end state of the same capture at rest: after enabling Vertical auto layout the group frame has not moved from its original position

Gap

Gap is a single numeric field (itemSpacing). One edit is one undoable entry and every adjacent gap between children updates at once.

Tuning the gap, padding, alignment, and sizing of a vertical auto-layout group

Padding

Padding is four independent sides with a linked/unlinked toggle. Linked, one edit drives all four sides equally; unlinked, each side is edited on its own.

Alignment

Primary axis alignment runs along the stack: Start, Center, End, Space between, or Space evenly. Counter axis alignment runs across it: Min, Center, or Max.

Sizing

Each axis has a Sizing toggle between Fixed and Resize to fit (hug contents). Switching to hug snaps the group frame to its children plus padding; switching back keeps the hugged size as the new fixed size. While Auto Layout is active, primary/counter sizing owns the group's box — the separate Layout → Resize control is hidden until you switch back to None.

An axis that hugs its contents and measures nothing has no size for a typed number to replace, so the Position fields refuse a size typed there; drag a layer into the group to give that axis a size, because switching it to Fixed does not give the group a size — it keeps the size it already has, which is nothing here.

A single group selected in the inspector with Auto layout active: the Auto layout panel is populated, and the Layout → Resize section is absent until Auto Layout is switched back to None

Reorder on canvas

Drag a child inside an auto-layout group to change its stack index. The stack re-solves as you drop, and the reorder is a single undo.

Dragging a child within an auto-layout group; the stack re-orders and re-solves

Editing text inside a stack

A stack re-solves when a child's own size changes, and an edit to a child's text is a size change. Type into a label inside an auto layout group and the stack settles in the same edit: a row that hugs its contents gets taller, the rows below move down by the same amount, the group's Resize to fit height grows with them, a Center counter-axis child is centred on the new row height, and the gap and padding you set are preserved. Changing a text layer's font size, font family, weight, letter spacing, line height, wrap width or box height does the same thing.

One undo puts the text and the re-laid-out stack back together — the text change and the layout settle in a single history step, exactly as a resized child and its stack are.

Typing a second line into a label inside a vertical auto layout card: the row grows, the rows below slide down, the hug-sized card gets taller and a Center-aligned icon re-centres.

The same card at rest after the edit: the label holds two lines, every following row has moved down with the 24 px gaps intact, and the card's height has grown to fit.

Imported auto layout

If a group arrived from a Figma .fig file with auto layout already set, Figpea reads those values and shows them in the panel so you can tune them — the .fig parser is still maturing, so report any file whose layout does not come through.

A hidden child takes no slot. Where the file marks a child of a stack hidden, the import leaves it out of the layout and keeps its own position from the file, so the stack is only as tall as the layers you can see — a component that carries hidden alternatives does not reserve space for them, and showing one again puts it back where the file has it. See Figma Import for what that renders like.

The same imported card at rest after the hidden child is shown: its icon button sits inside the card at the position Figma has, and the card's other rows have not moved.

A group imported from a Figma .fig file with its auto-layout values shown in the panel

Deferred fields stay untouched

wrap, childAlignSelf, childGrow, positioning, counterAxisSpacing, and grid have no control in this version, and every control here leaves them exactly as it found them.

A wrap that came from the file does take effect. A container imported from a .fig with Figma's wrap set lays its children out in rows that fit its width, keeps the file's own counterAxisSpacing between those rows, and is as tall as the rows it produced — so a wrapped grid stays the width it was designed at instead of running past its frame. See Figma Import for what that renders like. childGrow and grid auto-layout are read from the file but are not applied to the layout.

A child the file positions absolutely stays out of the stack. A component often places one child outside the stack its siblings sit on — a tooltip's pointer centred on one edge of its bubble is the usual case — and the file marks that child as positioned absolutely and gives it its own coordinates. The import keeps it there: it takes no row of its own, and the children that are in the flow are not pushed down by it. This is how the file is read, not a control — every control in this panel still sets only direction, gap, padding, alignment, and sizing.

A wrapping auto-layout container imported from a Figma file, open in the Figpea editor: its cards flow across several rows inside the container's width, with an even gap between the rows.

A fill that came from the file does take effect too. A child the file sizes to fill its container across the stack is drawn against the container's content box rather than at the width it was authored with: in a vertical stack it runs the full width inside the stack's padding — so a divider, a footer strip or a hover row reaches the card's edge instead of stopping short of it — while a child that fills along the stack (childGrow) is still read from the file but not applied. childAlignSelf has no control here: the value is honoured only where the file brings it. See Figma Import for what that renders like.

A note card imported from a Figma file, open in the Figpea editor: the divider under its header and the footer strip beneath it each run the full width of the card, reaching its right edge.

Undo

Every control is one undoable history entry — the engine re-solves the stack on each change.

Persistence & what it does not do

Auto layout is saved with your Figpea project (the .fp file). It is not written back into the .psd, .xd, or .fig you opened — saving never rewrites the original file. Auto layout applies to groups only; pages and project layers are out of scope, and only .fig carries auto layout on import (not XD or PSD).

Frequently Asked Questions

What is auto layout in Figpea? A group whose children re-pack into a stack you control.

Can I apply auto layout to a single shape or to a page? No — groups (folders) only. Shapes and page/project layers are out of scope.

Does Figpea import auto layout from Figma files? Yes for .fig — including Figma's spacing modes such as Space between — values are read and editable; stated conservatively, with the report-a-file path.

Does auto layout save back to my original .fig / .psd / .xd file? No; it lives in the Figpea project and is never written back.

How do I reorder items in an auto layout group? Drag a child on the canvas; the stack re-solves and it is one undo.

What about wrapping, grid, or absolutely-positioned children? There is no control for any of them here, but a container imported from a .fig with wrap set does lay its children out in rows that fit its width, with the file's own row spacing, and the group sizes to those rows. childGrow and grid auto-layout are read from the file but not applied to the layout; an absolutely-positioned child is — it keeps the place the file gives it and takes no row in the stack.

Does editing text inside an auto layout group re-flow the stack? Yes — typing into a label, or changing its font size, font family, weight, letter spacing, line height, wrap width or box height, re-solves the stack in the same edit, and one undo restores both the text and the layout.

More in Layer Operations

See all in Layer Operations