Next.js Discord

Discord Forum

Layouts

Answered
Shaurya posted this in #help-forum
Open in Discord
I have a layout which have nav and stuff but I don't want the layout to the login page, how would I do that?

18 Replies

ahh, use route groups
@Shaurya I have a layout which have nav and stuff but I don't want the layout to the login page, how would I do that?
use route group
(with-nav)/layout.tsx <-- render Nav here
(with-nav)/page.tsx
/login/page.tsx
@Ray use route group (with-nav)/layout.tsx <-- render Nav here (with-nav)/page.tsx /login/page.tsx
shouldn't there be two different route gruops? (with-nav) & (without-nav)?
oh
got it
nvm
can you please elaborate, didn't understand
this is my structure
@Ray the default one without nav lol
yeah, got confused, I read it like (with-nav)/page.tsx/login/page.tsx instead of seperate lines
@Shaurya can you please elaborate, didn't understand this is my structure
create a folder named (with-nav), and in that keep your pages with nav bar, and layout with navbar, and outside of that folder keep other pages without those nav bar.
Answer
checkout docs here
oh
the parentheses
got it, lemme do that
yeah, like this 👇
thanks, works perfect, didn't have use of routing groups before