Request: Sticky navbar affixed to container on scroll
See original GitHub issueIs your feature request related to a problem? Please describe. Following the introduction of the Fixed Navbar feature by issue #326, would it be possible to include a sticky navbar which affixes to the top/bottom of its container upon reaching a certain scroll threshold? Optionally, it could be expanded upon to hide the navbar on scroll down and reveal upon scrolling up?
Describe the solution you’d like
- Tuts+ - Sticky Positioning with Nothing but CSS
It’s a few years out-of-date… which works to our benefit since the adoption of
position: sticky
has increased significantly (CanIUse) across a number of browsers since then. - CSS-Tricks - position: sticky;
- CodePen - All CSS for sticky elements
Describe alternatives you’ve considered
- Mini.css - Landing Page Nav bar sticks to the top of the viewport on both desktop and mobile devices alike.
- Ant Design - Affix A more granular breakdown and demonstration of the sticky navbar behaviour.
- Headroom.js (optional) Admittedly, this is a script but the implementation of the “smart” sticky navbar is very smooth and would be ideal to target, if at all possible. More than happy for this to be offloaded to a separate issue/request if that makes feature management easier.
Thanks for your time and I really appreciate your suggestion to create this ticket from the original issue #2051. Hope you have a great day!
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
[Request] Sticky navbar affixed to container on scroll #2051
Admittedly, this is a script but the implementation of the "smart" sticky navbar is very smooth and would be ideal to target, if...
Read more >How to create a sticky navigation bar that becomes fixed to the ...
Now, just add the javacript to add and remove the fix class based on the scroll position. $(document).ready(function() { //change the integers below...
Read more >Responsive Sticky Navbar that Shrinks on Scroll with Tailwind ...
This is a tutorial to create a sticky navigation bar that shrinks when the user scrolls up, using Tailwind CSS & Alpine JS....
Read more >How to create an Affix or sticky Navbar ? - GeeksforGeeks
To create an affix or sticky navbar, you need to use HTML, CSS, ... can easily make the navigation bar sticky when the...
Read more >How to Create a Sticky Navbar [CSS & JS] - Alvaro Trigo
To create a sticky navbar, you use the position: fixed; CSS property to "stick" your navbar to the viewport, and position: sticky; ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Could you point me in the direction of a working implementation of this?
Thank you!