How to use constraints in Figma
Pin a layer to the edges of its frame in Figma. Open the Constraints control, set horizontal and vertical constraints, then resize the frame to test.

Quick answer
Select a layer inside a frame, open the Constraints control in the Position section of the right sidebar, then choose a horizontal and a vertical constraint from the dropdowns. Pick Right and Bottom to pin the layer to those edges. Then select the frame and change its Width to resize it.
Steps at a glance
- Select the layer inside your frame
- Click Constraints in the Position section
- Choose a horizontal constraint
- Choose a vertical constraint
- Select the frame in Layers
- Change the frame Width
Interactive demo
Summary
Constraints tell a layer how to behave when its parent frame changes size. Setting them keeps buttons, logos and panels anchored where you want them as a design is resized.
Step-by-step guide
Step 1
Select the layer
Click Rectangle 1 in the Layers panel. The layer must sit inside a frame such as Frame 1, because constraints are relative to the parent frame.
Step 2
Open the constraints controls
In the right sidebar, find the Position section and click Constraints. Two dropdowns appear: Horizontal constraints and Vertical constraints.
Step 3
Choose a horizontal constraint
Open Horizontal constraints and pick one of Left, Right, Left + Right, Center or Scale. Choose Right to keep the layer pinned to the right edge of the frame.
Step 4
Choose a vertical constraint
Open Vertical constraints and pick one of Top, Bottom, Top + Bottom, Center or Scale. Choose Bottom to keep the layer pinned to the bottom edge.
Step 5
Select the frame
Click Frame 1 in the Layers panel so the frame, not the layer, is selected. The sidebar now shows the frame's own layout settings.
Step 6
Set the frame width
Enter a new value in the Width field to resize the frame. Use this to test how the layer reacts to the constraints you chose.
Why this matters
You have a card with a button that must stay in the bottom corner. Without constraints, resizing the frame leaves the button floating in the wrong place. Setting them once means the layout holds as you try other sizes.
Frequently asked questions
Which constraint options can I choose?
Horizontal constraints offer Left, Right, Left + Right, Center and Scale. Vertical constraints offer Top, Bottom, Top + Bottom, Center and Scale.
Do constraints need a frame?
Yes. Constraints are relative to the parent frame, so place the layer inside a frame such as Frame 1 before setting them.
Related guides
Continue with more step-by-step guides for getting work done.
How to create a frame in FigmaLearn how to create a frame in Figma: pick the Frame tool, draw it on the canvas, and set its width in the Design panel on a free account.
How to use auto layout in FigmaLearn how to turn several layers into one auto layout frame in Figma, then change the gap and direction so the layers stay evenly spaced as they change.
How to align objects in FigmaLearn how to align objects in Figma: select several layers, then use the Alignment controls in the Design panel to line up tops and centers.
How to use Figma AI featuresLearn how to use Figma AI features: open Actions, run Make an image with a text prompt, and refine the generated image in a Design file.
How to use Figma SlidesCreate a Figma Slides file from the main menu, edit the title on your first slide, add a blank slide, and find the Present button to share your deck.
How to use grid layout in FigmaLearn how to switch a Figma frame to grid layout, then set the gap between columns and rows so its content sits in an even grid on the canvas.
Create interactive demos like this one — free, no coding required.
Start for free →