Layout & Design

Fixed and Sticky Positioning in Framer (Fundamentals Lesson 9)

Fixed and Sticky Positioning in Framer (Fundamentals Lesson 9)

Fixed and Sticky Positioning in Framer (Fundamentals Lesson 9)

Joseph

·

4:10

·

52K views

·

About this lesson

Fixed and Sticky positioning are two essential modes for controlling how elements move (or don’t move) as a visitor scrolls through your pages — but each has it’s own unique behavior.

In this lesson, we’ll explore how and why to use each — to keep important elements in view exactly when and where they’re needed.

https://www.youtube.com/watch?v=nPk_qEPrLwk&t=0s Intro

https://www.youtube.com/watch?v=nPk_qEPrLwk&t=3s Fixed positioning explained

https://www.youtube.com/watch?v=nPk_qEPrLwk&t=24s Setting fixed position in Framer

https://www.youtube.com/watch?v=nPk_qEPrLwk&t=51s Pinning to the viewport

https://www.youtube.com/watch?v=nPk_qEPrLwk&t=86s Fixed elements and content flow

https://www.youtube.com/watch?v=nPk_qEPrLwk&t=116s Sticky positioning explained

https://www.youtube.com/watch?v=nPk_qEPrLwk&t=146s Sticky positioning example

https://www.youtube.com/watch?v=nPk_qEPrLwk&t=156s Requirements for sticky positioning

https://www.youtube.com/watch?v=nPk_qEPrLwk&t=177s Using sticky offset

https://www.youtube.com/watch?v=nPk_qEPrLwk&t=191s Sticky positioning in action

https://www.youtube.com/watch?v=nPk_qEPrLwk&t=205s Wrap up

🌞 Start for free: https://framer.link/yt

📚 Learn more at: https://framer.link/yt-academy

💎 Join the Community: https://framer.link/yt-community

🎉 Follow on X: https://framer.link/yt-x

0:00fixed and sticky positioning are two0:02essential modes for controlling how0:04elements move or don't move as a visitor0:07Scrolls through your pages but each has0:09its own unique behavior in this lesson0:12we'll explore how and why to use each to0:14keep important elements in view exactly0:17when and where they're0:19[Music]0:21needed let's start with fixed0:23positioning a fixed position element0:25stays in the same spot on the screen no0:27matter how far the user Scrolls for0:30example think of a nav bar that never0:31leaves the top of the screen or a0:34floating action button that stays in the0:36bottom right corner either way it's0:38something that you want to keep visible0:40at all times when we set an element to0:42fix position it anchors itself to the0:45viewport which means it's tied to the0:46browser window instead of any particular0:49frame on the page to use fix positioning0:52we first need to make sure that our0:54design element in this case the nav bar0:56is a direct child of the breakpoint0:58frame now will have no problem switching1:01the position type from absolute to fixed1:04you might notice the positioning1:05controls that appear look similar to1:07those used for absolute positioning but1:09rather than pinning to a frame it's1:11pinning to the viewport itself with this1:14in mind I'll pin my Navar to the top1:16left and right edges of the viewport1:19this will keep it positioned at the top1:21while allowing it to scale horizontally1:23making Its Behavior a bit more1:25responsive also similar to Absolute1:27positioning is that when an element is1:29set to fix it's removed from the content1:31flow of the stack this means it'll no1:33longer push or pull other elements1:35around it allowing it to float above the1:38other content on our site so if I1:40preview my site you'll see that my nav1:42bar is fixed to the top and the rest of1:44the content Scrolls underneath it it's1:47that easy if you have issues with things1:49not overlapping properly don't forget1:51about that zindex property that we1:53talked about in the lesson on absolute1:55positioning now we know that fixed1:57positioning keeps an element locked to1:59the viewport at all times but sticky2:02positioning on the other hand allows an2:04element to scroll with the content until2:06it reaches the top of the viewport then2:08it sticks in place temporarily before2:11the bottom of its parent frame Scoops it2:13up and makes it continue scrolling again2:16this is great for things like sidebars2:18headers card layouts or even subnav that2:21we want to stay visible for part of the2:23scroll but not the entire time in this2:27example I have a pricing card next to a2:29ser of images and I want my pricing card2:32to stick to the top of the screen as we2:34scroll past the images the first thing2:37to know when using sticky positioning is2:39that our layer must be the child of a2:41stack or grid and every parent frame all2:44the way up the hierarchy needs to have2:46overflow set to visible or sticky just2:50won't2:51work okay so now that everything is2:53ready I'll set the position type of my2:55pricing card to Sticky we also get an2:58offset property to find how far down3:01from the top edge of the viewport this3:03thing should stick I'll set this to 1003:05pixels to give us a little cushion of3:07space with that set I'll switch over to3:09preview mode to see how it looks and3:12there we go the pricing card sticks to3:14the top of the viewport and stays3:15visible as the images to the left scroll3:18past then when the bottom of the parent3:20frame hits the bottom of the card it3:22gets scooped up and starts scrolling3:24again so now you've got a clear3:27understanding of fixed and sticky3:29positioning and you know when each one3:30comes in handy fix positioning for3:32keeping Design Elements locked in place3:34at all times as users scroll and sticky3:37positioning to let elements move with3:39the page until they hit the top of the3:41viewport and then start moving again if3:43and when their parent container Scrolls3:45out of view with these position3:47techniques you're ready to design3:49layouts that keep Essential Elements3:51right where they're needed within easy3:53reach for visitors we've just got a few3:55more layout tricks to cover so I'll see3:57you in the next3:58one e

Watch on YouTube ↗

More in this topic

8 Framer shortcuts you're probably sleeping on4:19
8 Framer shortcuts you're probably sleeping on
Layout & Design3K views · 2 months ago
Framer Update: Stack Sorting and Bento Grids2:16
Framer Update: Stack Sorting and Bento Grids
Framer Update7K views · 2 months ago
Sharing Vector Sets Across Projects (Vectors Lesson 7)3:41
Sharing Vector Sets Across Projects (Vectors Lesson 7)
Layout & Design1K views · 3 months ago
Connecting Vector Sets to the Framer CMS (Vectors Lesson 6)3:38
Connecting Vector Sets to the Framer CMS (Vectors Lesson 6)
Layout & Design2K views · 3 months ago
Animating Vectors in Framer (Vectors Lesson 5)4:25
Animating Vectors in Framer (Vectors Lesson 5)
Layout & Design4K views · 3 months ago
Customizing Vectors with Variables in Framer (Vectors Lesson 4)4:59
Customizing Vectors with Variables in Framer (Vectors Lesson 4)
Layout & Design3K views · 3 months ago
Replace component instances site-wide in Framer1:39
Replace component instances site-wide in Framer
Layout & Design4K views · 4 months ago
Creating and Organizing Vector Sets in Framer (Vectors Lesson 3)6:58
Creating and Organizing Vector Sets in Framer (Vectors Lesson 3)
Layout & Design3K views · 4 months ago

Create a free website with Framer, the website builder loved by startups, designers and agencies.