MASTER Figma Auto Layout Constraints & Resizing | Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
auto layout resizing constraints left right top top and bottom i know this is frustrating and i really feel your pain i got good and bad news for you the good news is by the end of this video you'll know everything you need to know in order to start mastering all the layouts and constraints on figma you'll know the ins and outs to help you build perfectly responsive components like the ones we see used by all the major products out there like this responsive header on instagram or a content card that automatically resizes depending on what content you place inside it will literally make your design life easier you'll save more time than ever be more productive and most importantly your designs will be fired the bad news is i need you to stay with me throughout this tutorial until the very end get yourself some coffee energy drink green tea or whatever you need i need you to pay attention pull up your figma and let's get cracking let's go the one core thing you need to understand in order to unlock the full potential of constraints is the relationship between a frame and the objects placed inside a parent frame is what the main container is called the one frame that holds all of the objects and elements inside the parent frame holds either child frames or child objects depending on the object being a frame too or just a loose object this is how figma differs from other platforms like sketch and adobe xd it's a powerful feature that allows you to create nested frames clicking on the objects placed inside you can see on the right panel here what the constraints for the objects are set to by default we have it set to top and left the constraints are defined for both the horizontal and the vertical axis for example if you need a floating action button like on android apps create a parent frame that positions the button on the bottom right corner define how and where it's positioned from the edges i'll just stick to a 16 pixel distance from the right edge [Music] and 144 pixels from the bottom and now independent of the size of the parent frame we want this object to always stick to the right and bottom edge of the screen just like this [Music] here's another example that shows a different context let's create a new screen let's say we want the object to stretch in size fully dependent on the parent frame if you want it to stretch horizontally then you set the constraint to left and right just like this and if you leave a 8 pixel margin on both sides and maybe even 8 pixel at the bottom then it's going to keep the same distance even when you resize the parent frame if you want the object to stick to the bottom then you just need to make sure that this goes from top to bottom in the vertical axis so resizing the parent frame will make it fully responsive make sure you understand the fundamentals of frame constraints before moving into section two play it back and follow along if you need to for all of your others let's keep going an auto layout frame is a regular frame with the auto layout property added to it it literally means that the layout of the frame automatically changes as the content inside changes it does so while maintaining the alignments and the paddings that have been defined for that specific frame the short command to turn a frame or an object into an audit layout is shift a by default depending on my auto layout frame is set to 8 pixels i can either choose to have the same padding size all around the 4 size of the object like if i want to turn this into 12 pixels or i can just individually set these settings to be whatever i want it to be as well for this example let's just stick to 8 pixels and i'll add a fill just to make sure that i can see the background of the auto layout frame too the alignment of the object within this frame is being defined just right here this means that if you change the size of the parent frame like this this specific setting defined this to be in the top left corner if you place it in the center it's going to be in the center all the time no matter the size of the pan frame let's keep it vertically and horizontally centered as we resize the parent frame you can see that the object placed inside is fixed in width and height habit the object selected you can choose to either have it be fixed or filling the container meaning taking up all the space it possibly can in both of the axes so in the horizontal axis if we fill the container it's going to fill it all the way out in the same way you can do and the vertical axis as well it's filling up all the possible space but then this frame taken into consideration the paddings that we defined earlier for the parent frame if you're designing a bottom navigation bar for an app you'll have a parent frame that holds individual tab frames inside which in turn contains the actual icons let's start off with the tab frame first i'll create a placeholder icon of 32 by 32 pixels turn that into an auto layout shift a add a fill color we'll use the same one as this example rename this tab frame set a fixed width of 64 pixels by resizing this frame you automatically made the resizing setting to fix with and all you have to do now is to go to alignment settings under auto layout and set this to vertically and horizontally centered now let's take this frame and add three of these tabs inside of an auto layout frame select all of these click shift a i'll set the spacing between the items to be 12 pixels and as you can see the parent frame will increase in size automatically depending on the size or the number of items that are placed inside of the parent frame if the size increases that by default the parent frame will increase as well the resizing setting for the pan frame is hugging the content both vertically and horizontally we can override this by manually resizing the parent frame turning this into fixed width the items inside stay the same because they define to be fixed in size too now we can choose how we want to define the size of these items individually fixed fill or hug the contents when choosing to fill the container then only that individual atom will take up all the remaining space available in the parent frame if we choose to hug the content the frame will take up all the space necessary to hold the object inside while respecting the padding values that we have set for this specific child frame for the sake of the bottom navigation we want to create let's select all these tabs and have them fill the container now they'll take up an equal amount of space to fill the parent container when we resize the pan frame the child frames inside will automatically adjust and be fully responsive you now have an auto layout parent frame containing fully responsive child frames now there were a lot of things covered in this segment so if you're not 100 confident yet i want you to play back the steps until all of these techniques sit right in the pocket when you're done let's move on to the final step [Music] when you perfect the techniques in sections one and two this last step will be self-evident take the bottom navigation parent frame we created in section 2 and place it inside of a new frame let's take one of the pre-built iphone frames place the bottom navigation inside resize it to make it fit when being selected you'll see that you have a set of different options to the right constraints and resizing this setting helps you define both the auto layout resizing behaviors fixed or hug contents as well as the constraints in relation to the parent frame if you choose hug contents for the horizontal axis the left and right constraint will be unavailable for obvious reasons it won't be able to stretch horizontally as the parent frame stretches if it's supposed to hug the content too let's make it fixed set the constraint left and right and it can hug the content in the vertical axis and be constrained to the bottom edge of the parent frame sometimes when placing an auto layout frame inside of a new frame figma can reset some of the settings we have set earlier so make sure that each individual tab frame inside of the parent frame still fills the container now when you resize the parent frame to any device size the bottom navigation bar will be perfectly responsive if you've made it this far in the video i want you to drop a comment below saying i want a live session spend some time mastering these techniques and if enough of you guys are up for a live session i'll go live to answer your questions and create a couple of real life examples of components using the same techniques like always thank you for checking in and i hope you find this lesson valuable make sure to subscribe turn on notifications and hit the like button below for more videos like this don't forget to comment if you want the live stream workshop on this topic see y'all in the next video peace
Info
Channel: Wired to Design
Views: 51,901
Rating: undefined out of 5
Keywords: auto layout, auto layout figma, auto layout figma mizko, auto layout figma tutorial, autolayout tutorial, figma auto layout, figma auto layout components, figma auto layout tutorial, figma autolayout, figma autolayout tutorial, figma constraints, figma tutorial, figma tutorial for beginners, figma web design, how to use autolayout figma, how to use figma auto layout, product design, product designer, responsive auto layout figma, tutorial autolayout, ui design, ux design
Id: fGxrLoxa30A
Channel Id: undefined
Length: 10min 46sec (646 seconds)
Published: Fri Jan 28 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.