-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose dynamically setting the topLevelNavbarItems in v4 #3620
Comments
Trying to come up with a solution in the referenced PR above. It's not working though, so if anyone can spot the issue or suggest a better way, or if there's a workaround, I'm all ears. |
I think I had a similar problem when I did a migration of maybe we can add the possibility to set |
Would this also add new links? Not just hide existing ones? |
of course not
we cannot pass functions from server components into client components
show me an example with screenshots of what you want to achieve |
Yes, I understand that, but the
I can do better, I can show you a live example, using nextra v3. Based on the URL, the navbar has items added based on route. More specific page (notice Guides and Reference added to the navbar that are based on the route): You can see it here https://sphil.xyz |
The problem with your PR is that even if you make work the When you will visit the root page you'll get a flash of I am not interested and not convinced in this feature for now |
Ok, fair enough. I'll just have to get creative then :) thank you for your time and attention! Feel free to close this issue. |
Thank you 🙏 let’s keep it open if anybody wants to have a similar feature or has an idea of proof of concept that could be easily integrated into Nextra |
Is your feature request related to a problem? Please describe.
In v3, you could alter the navbar items by filtering what was passed to its props, such that you could dynamically change the navbar based on the path (the old turbo.build page used to do this). In v4, the navbar retrieves the items internally through a hook, preventing feeding it the modified list of items.
Describe the solution you'd like A clear and concise description of what you
want to happen.
Want to be able to modify the navbar items.
Describe alternatives you've considered A clear and concise description of
any alternative solutions or features you've considered.
Not sure what other workarounds are possible here. I want to be able to modify that list since that list also goes into the mobile navbar etc.
Additional context Add any other context or screenshots about the feature
request here.
The text was updated successfully, but these errors were encountered: