Create a DROPDOWN MENU in Figma (Tutorial)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video we're going to take a look at creating a functional drop down menu in figma so this is an interactive component that you can place onto your forms onto your form prototypes and you'll be able to select from a multitude of options and each state is going to reflect the specific option that you have selected in this drop down menu if you'd like to save time and use this in your own Project Check the link in the description that will take you to my store where you can download the source file for this component and now let's get started with creating this interactive component the first thing we need to do is create One Singular option so I'm going to choose the text tool to type in option number one I'm going to zoom in a little and then just press command 0 to view this at 100 size I'm going to select the text object and press shift a to create an auto layout I'm going to rename this option and I'm going to adjust paddings as well as the fill that's probably probably going to be white and these horizontal paddings are going to be 20 with vertical ones being 14. at this point we are ready to turn this into a component so I'm going to go over here and click this icon to create a component we got an option component and we're going to add another state this state is going to be called hover and then we are going to create another state and this state is going to be called selected right so we have an option component with three states default hover and selected I'm going to rename this property to state and I'm gonna actually go to prototype and start prototyping this this function right so I'm gonna use this little circle connect that over here and say while hovering change to State hover right that makes sense I'm gonna go for 150 milliseconds uh smart animate and then something similar right here so from the hover State it's going to go to the or actually never mind this is the only interaction we're gonna set up within the option component and we're just we just need to somehow differentiate visually that this is a hover State and this is a selected state so what do I think we can do here we can change this anytime later but I think with the selected one we could do like a stroke however only on the left side right so this is what I have in mind so this would show that we have that this option is selected this hover State I think could have like another fill black black one with the opacity of 10 so when you hover over this option you get you know it gets a little bit darker and right now we are ready to actually use an instance of this component of this option component and create an option menu so I'm going to duplicate this two times or actually let's create five options right so that's five in total I'm gonna select all of these and then press shift a to create again an auto layout I'm going to name this Auto layout list of options and then turn that into a component itself I'm going to change the size like this press enter and with all of these I'm going to go to horizontal resizing over here and set that to fill container that way when you change the dimensions of this you get this kind of behavior right additionally we could do go over here select all of these text objects and go for fill container as well this means that this will now happen right it's not necessary because we won't be getting and a list of options that is this small but just to make it really working properly I'm gonna go over here to create a test frame test frame right and then I'm going to use an instance of this list of options to test if our behavior of the menu is as intended make it a little bit bigger and Center that select the frame and launch the Prototype right so you can see that we are getting this behavior that is desirable we might want to reduce the amount of darkening we get to like seven and let's just make one of these selected right so I'm going to reset the Prototype so this is this is the behavior you get right now this option looks selected and these all these you can hover over these and you get this change what I'm thinking right here is if you hover over the option that you have selected this should change to this hover State as well so let's just go over to the option option component while hovering change to State hover right so it goes both from this state and this state let's test this out right you can see we get we get this Behavior but since the line disappears we could do actually let's do this a little bit more interactive I'm going to create another state this one's going to be called selected hover hover right and this would mean that we will get the same darkening but with the change that now actually when we hover over selected option we get this right I think that's better so this behaves accordingly perfect I'm gonna speed up these interactions I'm gonna go for 100 milliseconds um the preview is a little bit slower because I'm recording a video so that probably hurts the performance of the rendering in figma but um yeah I would just like to see something a little bit quicker right yeah this this is better um perfect I'm going to revert this back to default and I'm going to use this one of these instances of the option component and then detach that by pressing command option b to create our drop down the actual drop down menu so this is going to say select option it's going to be this big it's not gonna have a fill it's gonna have a stroke though it'll be rounded like this 10 probably I think we could do a bigger padding and then I'm going to use the pen tool to create an arrow like this copy that and paste that inside this Auto out this one is going to have probably two pixels it's going to be a bit stronger I'm gonna change the alignment of the auto layout and I'm going to go here to go for space between spacing mode if you'd like to learn more about oddly I would go and check out my channel I have done some tutorials on Arts layouts so definitely if you need to be updated in that area go and watch those videos right so we have our drop down menu I'm gonna reduce the the amount of stroke right here and now that I think about it you probably should reduce oops we probably should reduce the vertical padding of these to like 12. you can see that it immediately updates all of these instances and that's why you want to work with components as much as possible when creating components like this or even Design Systems especially when you're creating Design Systems and the next step we're going to do now is taking this drop down menu and turning that into a component like this so we get drop down menu component that behaves like this I'm gonna create a new variant at this variant is going to be called default default basically and this one's going to be called default as well there's going to be a conflict but we're gonna we're gonna change the property name to option so there is no option in this in this state and then we're going to create another property and this one's going to be called visible visible options right and in this one visible options is going to be yes and this one's going to be no there is no conflict anymore but we actually have to include these options in this variant which means using this list of options dropping it over here really quickly just changing the option numbers reflect final result so three option four option five and taking this pressing command X selecting this variant and pressing command V this happened we don't want that but we're going to fix that by going over here and selecting absolute position and we're going to make sure that it's positioned precisely below the bottom line like this right we're going to probably change this position to 57 not 57.5 and align that to the left and then just do this make it the same width as the drop down menu right so we get these two variants where you have select an option visible and then you have all of these options visible right we're gonna also rotate this this arrow and then take this initial default variant and click plus it moved all the way over here but we're gonna just fix that by using the x coordinates positioning it's right here um this one's gonna say option one so this is option default this is option one and this is also gonna say option one right then I'm gonna create another variant this one's gonna say option two and I'm gonna repeat the process for all five options so I have option one with option one two three four you get the point right I'm gonna select all of these and then just go to visible options and set that to no right none of these have this thing going on right now what I'm going to do now is Select option one in this drop down menu select this circle over here and then click and drag to connect that to option one same with option two option three option four and option five all these are going to be on click and then what I'm gonna do is duplicate option one and set visible options to yes right so we have for each option there are going to be two variants select all of these and ALT click and drag or option click and drag to create Alternatives like this then I'm going to select all of these arrows and add the rotation to 180 that when that happens you can see that we have all these are rotated to show that the menu can be collapsed and finally I'm gonna copy this list of options select all of these variants right here and then press command V right so we can see that this thing happened we we basically created a variant like this but for all the options now if you actually open the drop down menu from option one you want to see the state of one of these options the option option one as selected right so when you click from option one to here you want to see this same with option two and option three and option four and five as well what you also want to do is being able when there is this drop down menu placed in a prototype you want to be able to click on it and then have this dialog open right so I'm gonna again select this variant and this circle in Prototype and click and drag like this so on Click Change to option default but with visible options smart animate is out and also at the same time when I click this area again I want to return back I want to close this window right now let's do this for all these remaining options and this is what we get now why don't we test the functionality of this component I'm going to remove this from the test frame make the test frame a little bit bigger and then go to assets and search for drop down menu place that over here and Center it actually not let's not Center that let's move that to the top part of this interface and we should get a functional drop down menu let's launch the Prototype and this is what we get we get the drop down menu that we can open but we can also close it again make up our mind we can select option one option two three four five you can see that this menu reflects which option we currently have selected and also not only you can change these options but you can also click the option three again and close the window right that's very important because when you're under option three and you click option three well you need to go back to option three right so this is that makes sense right so the functionality is here this is how you set up a functional drop down menu a figma now I'm just going to take a couple minutes to improve the visual the look of this to make this look really really good and pleasant to interact with foreign any option we want and we can switch the options and we get this nice hover interaction as well as close and open interaction leave a like if you learned something new in this tutorial check the link in the description if you'd like to download this interactive component and I will see you in the next one
Info
Channel: Mavi Design
Views: 162,464
Rating: undefined out of 5
Keywords:
Id: uI3k9Ol-Mp4
Channel Id: undefined
Length: 14min 0sec (840 seconds)
Published: Wed Oct 05 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.