Figma Auto Layout Button Group Guide
Learn how Figma’s Auto Layout keeps button groups aligned and spaced when items are added or removed, with a step‑by‑step example and notes on limitations.
16 May 2026, 17:43 UTC

Problem: Keeping spacing consistent when items change
When you add or remove a button, icon, or text layer inside a frame, the surrounding elements often drift out of alignment. You end up moving each item manually, which is tedious and error‑prone.
Thesis: Auto Layout turns a static frame into a responsive container
Figma’s Auto Layout feature automatically manages spacing, alignment, and reflow, so the container adapts whenever its children change.
Enabling Auto Layout on a frame
- Select the frame you want to make responsive.
- In the right‑hand Design panel, click the
Auto Layoutbutton (the icon looks like a rectangle with arrows). - Figma converts the frame into an Auto Layout frame and exposes direction, padding, and spacing controls.
Configuring direction, padding, and spacing
- Direction – Choose
Horizontalfor rows orVerticalfor columns. - Padding – Set uniform padding or individual top/right/bottom/left values.
- Spacing – Define the gap between sibling items.
These values behave like CSS flexbox properties: flex‑direction, padding, and gap.
Nesting Auto Layout frames for complex UIs
For layouts that need both rows and columns, place an Auto Layout frame inside another Auto Layout frame. The inner frame inherits the parent’s direction but can override it.
Example: a card component with a horizontal header (title + icon) and a vertical body (description + actions).
Worked example: Button group that stays centered
- Create a frame and add two
Textlayers labeled “Prev” and “Next”. - Select the frame and enable Auto Layout.
- Set direction to
Horizontal, padding to16pxall around, and spacing to8px. - In the Design panel, set the frame’s
Horizontal resizingtoFill containerandVertical resizingtoHug contents. This makes the group expand horizontally while keeping its height tight to the text. - Select the frame and click the
Centeralignment button so the group stays centered within its parent. - Now duplicate the “Next” button or delete the “Prev” button. The remaining buttons re‑flow automatically, preserving equal spacing and centering.
To verify the behavior, switch to Dev Mode, select the Auto Layout frame, and open the Inspect panel. You will see CSS‑like values such as display: flex; flex-direction: row; gap: 8px; padding: 16px; confirming that Auto Layout is generating flex‑like layout properties.
Trade‑off: Abstraction vs. pixel‑level control
Auto Layout adds a convenient layer of abstraction, but it can obscure exact pixel positioning. If you need to fine‑tune a single element’s location without affecting siblings, you may have to temporarily disable Auto Layout or use absolute positioning plugins, which can cause unexpected behavior when those plugins modify frame geometry.
Actionable closing
Start with a simple component—like a button group—enable Auto Layout, experiment with padding, spacing, and resizing settings, then propagate the pattern across your design system. Repeating this practice yields consistent, maintainable UI that adapts to content changes without manual re‑adjustment.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.