Apply constraints to define how layers resize
This article is available for both the previous Figma UI and the new Figma UI. Use the toggle at the bottom left of the page to select your current UI. Get to know UI3: Figma’s redesign →
Who can use this feature
Supported on any Figma plan.
Any one with can edit access can apply and edit constraints.
Constraints tell Figma how layers should respond when you resize their frames. This helps you to control how designs look across different screen sizes and devices.
You can check out the video below, or continue reading to find out more.
Horizontal and vertical constraints
You can apply constraints along both the x (horizontal) and y (vertical) axis.
We set a layer's constraints to Top and Left by default.
Horizontal
Horizontal constraints define how a layer behaves, as you resize the frame along the x axis.
- Left maintains the layer’s position, relative to the left side of the frame.
- Right maintains the layer’s position, relative to the right side of the frame.
- Left and right maintains the layer’s size and position relative to both sides of the frame. This may cause layers to grow or shrink along the x axis, when resized.
- Center maintains the layer’s position, relative to the horizontal center of the frame.
- Scale will define the layer’s size and position as a percentage of the frame's dimensions. It will then maintain those proportions as you resize it.
For example: The frame's width is 100px and the layer's width is 70px, so the layer takes up 70% of its parent frame. If we resize the frame to 200px wide, Figma will resize the layer to a width of 140px, 70% of 200px.
Vertical
Vertical constraints define how a layer behaves, as you resize the frame along the y axis.
- Top maintains the layer’s position, relative to the top of the frame.
- Bottom maintains the layer’s position, relative to the bottom of the frame.
- Top and bottom maintains the layer’s size and position relative to the top and bottom of the frame. This may cause layers to grow or shrink along the y axis, when resized.
- Center maintains the layer’s position, relative to the vertical center of the frame.
- Scale will define the layer’s size and position as a percentage of the frame's dimensions. It will then maintain those proportions as you resize it.
Note: Depending on the layer’s position, more than one constraint may achieve the same result.
Apply constraints to a layer
You can apply constraints to any layer within a frame. It's not possible to apply constraints to layers outside of a frame, or layers in an auto layout frame.
- You can also apply constraints to frames you have nested within other frames.
- You can apply both horizontal and vertical constraints to layers.
- You can't apply constraints to groups. A group will inherit its bounds from the layers contained within it. They aren't considered a single layer with bounds.
Note: If you apply constraints to a group, Figma applies constraints to the individual layers.
To set the constraints for a layer:
- Select the layer or parent within the frame. The blue dotted line on the canvas shows which constraints are currently applied.
- Click [icon] Constraints from the Position section of the right sidebar.
- Adjust the vertical and horizontal constraints.
- Use the drop down menus to set the layer's constraints.
- Or, click on the lines in the interactive diagram to select a constraint.
Tip! Hold down Shift to select or apply more than one constraint at a time. For example: left and right constraints.
Ignore constraints
Sometimes you may want to resize a frame or layer, without using the constraints that are applied to it. You can temporarily ignore any constraints applied to a layer by holding down a modifier key.
- Mac: Hold down Command when you resize
- Windows: Hold down Ctrl when you resize
Constraints and layout grids
Constraints give you a basic framework for positioning layers within a frame. When it comes to more complex designs, we need more precise control and flexibility. This ensures our designs behave when resized.
That’s where grids come into play. When you use a grid within a frame, Figma aligns any layers within the frame to that grid. Working with constraints and layout grids →
Who can use this feature
Supported on any Figma plan.
Any one with can edit access can apply and edit constraints.
Constraints tell Figma how layers should respond when you resize their frames. This helps you to control how designs look across different screen sizes and devices.
You can check out the video below, or continue reading to find out more.
Horizontal and vertical constraints
You can apply constraints along both the x (horizontal) and y (vertical) axis.
We set a layer's constraints to Top and Left by default.
Horizontal
Horizontal constraints define how a layer behaves, as you resize the frame along the x axis.
- Left maintains the layer’s position, relative to the left side of the frame.
- Right maintains the layer’s position, relative to the right side of the frame.
- Left and right maintains the layer’s size and position relative to both sides of the frame. This may cause layers to grow or shrink along the x axis, when resized.
- Center maintains the layer’s position, relative to the horizontal center of the frame.
- Scale will define the layer’s size and position as a percentage of the frame's dimensions. It will then maintain those proportions as you resize it.
For example: The frame's width is 100px and the layer's width is 70px, so the layer takes up 70% of its parent frame. If we resize the frame to 200px wide, Figma will resize the layer to a width of 140px, 70% of 200px.
Vertical
Vertical constraints define how a layer behaves, as you resize the frame along the y axis.
- Top maintains the layer’s position, relative to the top of the frame.
- Bottom maintains the layer’s position, relative to the bottom of the frame.
- Top and bottom maintains the layer’s size and position relative to the top and bottom of the frame. This may cause layers to grow or shrink along the y axis, when resized.
- Center maintains the layer’s position, relative to the vertical center of the frame.
- Scale will define the layer’s size and position as a percentage of the frame's dimensions. It will then maintain those proportions as you resize it.
Note: Depending on the layer’s position, more than one constraint may achieve the same result.
Apply constraints to a layer
You can apply constraints to any layer within a frame. It's not possible to apply constraints to layers outside of a frame, or layers in an auto layout frame.
- You can also apply constraints to frames you have nested within other frames.
- You can apply both horizontal and vertical constraints to layers.
- You can't apply constraints to groups. A group will inherit its bounds from the layers contained within it. They aren't considered a single layer with bounds.
Note: If you apply constraints to a group, Figma applies constraints to the individual layers.
To set the constraints for a layer:
- Select the layer or parent within the frame. The blue dotted line on the canvas shows which constraints are currently applied:
- Adjust the vertical and horizontal constraints in the constraints settings in the Properties Panel.
- Use the drop down menus to set the layer's constraints.
- Or, click on the lines in the interactive diagram to select a constraint.
Tip! Hold down Shift to select or apply more than one constraint at a time. For example: left and right constraints.
Ignore constraints
Sometimes you may want to resize a frame or layer, without using the constraints that are applied to it.You can temporarily ignore any constraints applied to a layer by holding down a modifier key.
- Mac: Hold down Command when you resize
- Windows: Hold down Ctrl when you resize
Constraints and layout grids
Constraints give you a basic framework for positioning layers within a frame. When it comes to more complex designs, we need more precise control and flexibility. This ensures our designs behave when resized.
That’s where grids come into play. When you use a grid within a frame, Figma aligns any layers within the frame to that grid. Working with constraints and layout grids →