Next.js Discord

Discord Forum

NextJS layouts

Answered
Serengeti posted this in #help-forum
Open in Discord
SerengetiOP
I need to add navbar to all pages except login and signin. How to achieve that?
I tried to put the navbar in the root layour but this is for all pages.
Answered by B33fb0n3
you can define multiple root layouts. You can find more information here: https://nextjs.org/docs/app/building-your-application/routing/route-groups#opting-specific-segments-into-a-layout

Please mark the message as solution if it's the solution @Serengeti
View full answer

5 Replies

share your code
You can check pathname and not render navbar on login and signin pages
you can define multiple root layouts. You can find more information here: https://nextjs.org/docs/app/building-your-application/routing/route-groups#opting-specific-segments-into-a-layout

Please mark the message as solution if it's the solution @Serengeti
Answer
good to know