Layout & Design, Navigation
Navigations: Desktop Menus
Navigations: Desktop Menus
Navigations: Desktop Menus
Benjamin
·
7:13
·
42K views
·
About this lesson
This video tutorial covers the the recently introduced Viewport unit support for the Min Height and Max Height properties for your Pages and Components in Framer. This allows you to design incredible desktop navigations within a single Component. Demo: https://navs-desktop.framer.wiki/
🌞 Try Framer for free: https://framer.com
🎉 Follow on Twitter: https://twitter.com/framer
💎 Join Community: https://www.framer.community
0:00yo my name is Benjamin and in this video0:03I'm excited to cover new properties that0:07unlock new types of desktop navigations0:09you can now use viewport units within0:12the Min and Max height properties and0:16these will work on any layer within your0:18page but also within components so let's0:22dive into our demo project and have a0:24look at how this works we'll create a0:27desktop navigation from scratch so here0:31we have a simple topar with a logo and a0:34button it spins to the top left and0:37right sides and it has a fixed width and0:40height and we can right click to turn0:43this into a component0:45I'll hit create and this brings us into0:49the component canvas so here we'd like0:53to create two variants the first one0:55will be the open variant or the expanded0:59navigation state1:01and we'll create another variant called1:03closed which will essentially be the1:06initial state of the top bar so here1:09I'll set the height to something like1:11800 pixels1:13and then I'll zoom out to create a1:16second variant1:17and this we'll call the closed variant1:20and we'll give this one a height of 641:24pixels again because we'll use this as1:26the initial State later making the1:29primary variant the expanded state in1:32setups like this is quite useful as it1:35allows us to edit all the links in one1:38go without creating unnecessary variant1:41overrides I'll select the text layer1:44here remove the variable from the1:47content property and let's label this1:50with close1:52and then we'll label it menu again in1:54the second variant1:57[Music]1:59next we'll go back to the primary2:01variant and select the wrapping stack of2:06our text label and with that selected2:09I'll hit L to add a new interaction on2:13click to the second variant and I'll do2:16the same thing in Reverse so we can now2:19click to cycle between these two2:22variants2:23next let's add some links to our menu so2:27I'll hit D and I'll add a text layer2:30onto the canvas and I'll also give it a2:34text style now before I drop it in I'd2:37like to quickly show you that we have2:39this logo and button stack that is2:42absolutely positioned within our2:44navigation so it doesn't occupy any2:47space in our stack it will always be2:50positioned 20 pixels from the top left2:53and right sides and here you'll see that2:56the navigation itself is a stack so2:59let's go back to our text layer and drag3:02it onto the navigation and I'll hit3:05command D to duplicate it a few times3:08adding a unique label to each navigation3:12item then I'll select all navigation3:15items right click and I'll hit add stack3:19and I'll set the width and height of3:22this stack to fill I'll also set a line3:26to left and I'll give this a padding of3:2820 pixels this is normally where we3:31would add the links but we'll skip that3:33part in this video instead we'll focus3:36on the new properties that can help us3:39solve the issue we now have in this3:41setup we would like for this component3:43to animate from its close date of 643:46pixels to the open state that should3:50occupy the entirety of the viewport3:52however our links are set to fill so3:55they take up the available space which3:57would give us unwanted animations more4:00so this wouldn't really animate to the4:03viewport at all given that we have a4:05fixed height set of 800 pixels with this4:08release we can now fix both of these4:11issues I'll select the links and I'll4:13add a Min height property I'll then set4:16the type to viewport so we get 100 VH4:20AKA it occupies the entirety of the4:23viewport and we can set the heights of4:27the parent stack to Auto and then we can4:30reselect the links stack and set its4:34height to Auto as well4:36so we're now animating from a fixed4:39height of 64 pixels to the entirety of4:42the viewport plus setting this minimum4:45height also fixed our links collapsing4:48in the closed variant4:51and just like you can do with fixed4:53layers on your breakpoints you can4:55resize this viewport Bill to affect how4:58the viewport height is represented on5:01the canvas and now you can even double5:05click on it to set a manual value5:10with our basic setup in place it's time5:13to go back to the home page and make5:16some final edits here5:18first we'll want to set the initial5:20variant to the closed variant5:24we'll also want to set the position type5:26to fixed and finally we know we're5:30animating the height here so we want to5:33make sure the height is set to auto5:36all right and with that in place let's5:39go ahead and give our page a preview5:42and as we click on menu the navigation5:45animates from 64 pixels to the entirety5:49of the viewport5:51however our animation is quite fast so I5:54can go back in and change the transition5:57settings as such stiffness to 300 and6:02damping to 50. and let's give this6:05another preview6:09that's much better6:11[Music]6:12we can also play a bit with the6:14background so for example we could give6:17it some Alpha so you can still see the6:21background colors I'll set it to about6:2360 percent and then we can go back to6:26the preview6:29and there we go now there's a lot more6:32we could do here like add custom appear6:35animations or hover variants and you can6:38find a final version of this demo with a6:41few of these extra additions in the6:44description down below and that's pretty6:46much it for this video we hope you enjoy6:49these new features and stay tuned for6:52more Navigation updates coming soon6:56[Music]6:58foreign7:03foreign
More in this topic
8 Framer shortcuts you're probably sleeping on
Layout & Design3K views · 2 months ago
Framer Update: Stack Sorting and Bento Grids
Framer Update7K views · 2 months ago
Sharing Vector Sets Across Projects (Vectors Lesson 7)
Layout & Design1K views · 3 months ago
Connecting Vector Sets to the Framer CMS (Vectors Lesson 6)
Layout & Design2K views · 3 months ago
Animating Vectors in Framer (Vectors Lesson 5)
Layout & Design4K views · 3 months ago
Customizing Vectors with Variables in Framer (Vectors Lesson 4)
Layout & Design3K views · 3 months ago
Replace component instances site-wide in Framer
Layout & Design4K views · 4 months ago
Creating and Organizing Vector Sets in Framer (Vectors Lesson 3)
Layout & Design3K views · 4 months ago