Auto moving single items in navigation to dropdown in nav bar
Unanswered
Cesky Terrier posted this in #help-forum
Cesky TerrierOP
Hey! So I'm working on a project using and I'm wondering how to have a navigation bar with items, but depending on the width, it will automatically hide items one by one in a dropdown if needed.
A good example of what I'm trying to replicate would be what's on https://blog.github.com. Note how as you make the screen width smaller/wider, it moves items in and out of the "More" dropdown on a per item basis, rather than doing something like hide all the items and show a dropdown depending on the width.
Anyone ever built something like this before and willing to share some advice/examples? 🙏🏻
A good example of what I'm trying to replicate would be what's on https://blog.github.com. Note how as you make the screen width smaller/wider, it moves items in and out of the "More" dropdown on a per item basis, rather than doing something like hide all the items and show a dropdown depending on the width.
Anyone ever built something like this before and willing to share some advice/examples? 🙏🏻
4 Replies
Possible solution that comes to mind is hard coding the visibility with media query. At specific media queries you can hide an element from navbar and enable that in dropdown. Not the best approach but will get it done if you do not have a lot of dynamic content.
Cesky TerrierOP
Hey, thanks for the reply. I have tried something like this a few days ago (never committed the code because I couldn't get it working). You wouldn't by any chance be free to chuck together an example on codesandbox would you? I know I'm asking a lot, no pressure, only if you're interested.
Nah sorry, Im struck in a project myself.
Cesky TerrierOP
Aye I saw and had a look, sadly out of my comfort zone to offer any help. Best of luck