Navbar Component into root layout
Unanswered
Swedish White Elkhound posted this in #help-forum
Swedish White ElkhoundOP
Hi, im trying to put a navbar in my layout file for my home page, i also put another layout for the sidebar into my dashboard folder in the app directory somehow i see the navbar in my dashboard, any reasons why?
20 Replies
Please provide more information, what is your project structure?
Are you using Route Groups? Normal layouts are nested by default
@fuma Please provide more information, what is your project structure?
Swedish White ElkhoundOP
in my app directory i have my layout.js and my page.js
and my dashboard folder
in my dashboard folder i have layout.js and page.js
and some reason the navbar component is in my dashboard page
your layout is nested, it's expected that your navbar is displayed in dashboard folder
Swedish White ElkhoundOP
how do i unnest it?
You should read the docs:
https://nextjs.org/docs/app/building-your-application/routing/pages-and-layouts#nesting-layouts
To have unique layouts for each pages under a specific folder, use [Route Groups](https://nextjs.org/docs/app/building-your-application/routing/route-groups)
https://nextjs.org/docs/app/building-your-application/routing/pages-and-layouts#nesting-layouts
To have unique layouts for each pages under a specific folder, use [Route Groups](https://nextjs.org/docs/app/building-your-application/routing/route-groups)
@fuma You should read the docs:
https://nextjs.org/docs/app/building-your-application/routing/pages-and-layouts#nesting-layouts
To have unique layouts for each pages under a specific folder, use [Route Groups](https://nextjs.org/docs/app/building-your-application/routing/route-groups)
Swedish White ElkhoundOP
does the root layout show up in every page?
cause that's where i put my navbar
component
yes
Swedish White ElkhoundOP
ohhh
so uh where do i put my navbar component
the docs have answered all these things, tbh, you really should read the docs before asking the question
Swedish White ElkhoundOP
i was kinda confused
with the d ocs
Read through all the pages under routing category
@Swedish White Elkhound so uh where do i put my navbar component
In the route group, with all pages that you expected to have a navbar