Conditional/dynamic display of top navbar item #5307
Replies: 4 comments 1 reply
-
For now, you can't add custom navbar items, but I'd like to support that use-case in the future. To reduce the code you need to maintain when using swizzle, I'd like to introduce "placeholder/slot components" meant to be swizzled, such as If you want to handle login from a Docusaurus site, I'd suggest to swizzle the |
Beta Was this translation helpful? Give feedback.
-
Probably it isn't a response directly to the question, however, You could add just a button "Account" and then on the target page handle if the login form or the account page is displayed. |
Beta Was this translation helpful? Give feedback.
-
I am trying to do the same thing. Having a Sign In/Out button seems like a very common scenario. It is frustrating we have to resort to a hack for this since the rest of the nav config is so elegant. Do you have any different suggestions on how to do this? My current scenario is that there are some pages on the doc site that show user related stuff (API keys etc), so I create a new page and inside the page I have a |
Beta Was this translation helpful? Give feedback.
-
how's going with the feature? |
Beta Was this translation helpful? Give feedback.
-
I am trying to add signup, login, and logout using pages. So I want to hide the hide signup and login when the user is logged in and show the logout menu.
Currently, the navbar items are defined in docusaurus.config.js. Is there any other method / API to add the navbar item dynamically?
Beta Was this translation helpful? Give feedback.
All reactions