Intermediate
How to create flexbox layouts on Framer
Quick Answer
Create flexbox layouts in Framer by selecting frames or components and enabling the Layout property in the Properties panel. Configure direction, alignment, and spacing settings to create responsive, flexible layouts that adapt to content and screen sizes.
Prerequisites
- Basic understanding of Framer interface
- Familiarity with layout concepts
- Knowledge of frame and component basics
- Understanding of responsive design principles
1
Create a parent frame for your flexbox container
Press
F to create a new frame or select the Frame tool from the toolbar. Draw your frame on the canvas where you want your flexbox layout. This frame will act as your flex container that holds all child elements.Tip
Name your frame descriptively like 'Navigation' or 'Card Container' to keep your layers organized.
2
Add child elements to the frame
Create or drag elements into your frame such as text layers, images, or other frames. You can add elements by:
- Pressing
Tfor text - Pressing
Rfor rectangles - Dragging components from the Assets panel
- Copy-pasting elements from other parts of your design
Tip
Add at least 2-3 elements to see the flexbox behavior clearly.
3
Enable Layout properties on the parent frame
Select your parent frame and navigate to the Properties panel on the right. Look for the Layout section and click the toggle to enable it. You'll see a dropdown menu appear with layout options - select Stack to enable flexbox-like behavior.
4
Configure flex direction and alignment
In the Layout section, configure your flexbox properties:
- Direction: Choose Vertical or Horizontal to set flex-direction
- Alignment: Set how items align along the main axis (Start, Center, End, Space Between, Space Around)
- Cross Axis: Control alignment perpendicular to the main axis (Start, Center, End, Stretch)
Tip
Use 'Space Between' for navigation bars and 'Center' for card layouts.
5
Adjust spacing and padding
Fine-tune your layout spacing:
- Gap: Set the space between child elements using the gap slider or input field
- Padding: Add internal spacing around the container edges
- Individual spacing: Select specific child elements to override spacing with custom margins
Tip
Use consistent gap values (like 16px or 24px) throughout your design for visual harmony.
6
Set up responsive behavior
Configure how your flexbox responds to different screen sizes:
- In the Layout section, enable Wrap if you want items to wrap to new lines
- Set Fill or Fit constraints on child elements to control their sizing behavior
- Use Breakpoints to create different layouts for desktop, tablet, and mobile
Tip
Enable 'Fill' on one key element to make it grow and shrink with the container.
7
Test and refine your layout
Preview your flexbox layout to ensure it works as expected:
- Press
Cmd/Ctrl + Enterto enter preview mode - Resize the browser window to test responsiveness
- Check different device sizes using Framer's device frames
- Add or remove content to see how the layout adapts
Tip
Always test your layout with varying content lengths to ensure it remains flexible.
Troubleshooting
Child elements are overlapping or not aligned properly
Check that the Layout toggle is enabled on the parent frame and that all elements are direct children. Verify the Direction setting matches your intended layout orientation.
Elements are not wrapping to new lines when space runs out
Enable the Wrap option in the Layout section of your parent frame. Also check that child elements don't have fixed widths that prevent wrapping.
Layout breaks when adding new content or changing text
Set appropriate Fill or Fit constraints on child elements. Use Auto Width for text elements and ensure container has proper min/max width constraints.
Flexbox layout doesn't work in published site
Ensure you're using Framer's built-in Stack layout system rather than CSS flexbox. Check that all breakpoints have proper layout settings configured and preview in different browsers.
Ready to get started with Framer?
Put this tutorial into practice. Visit Framer and follow the steps above.
Visit Framer →