Next.js Discord

Discord Forum

Pages & Layouts

Unanswered
Giant panda posted this in #help-forum
Open in Discord
Giant pandaOP
Hi 👋 , I was wondering if someone could give me some guidance as to what is the 'correct' way to achieve the following.

I'm designing a sort of dashboard, and each subtree of this dashboard tree uses the same layout - which consists of a sidebar, and a header, with each page then rendering its respective content in the rest. How should I create this sidebar and header? Should they be 'components', as you might in raw react? Or is there another way of creating them?

7 Replies

Asian black bear
Are you asking about how to do this in the /app router?
@Asian black bear Are you asking about how to do this in the `/app` router?
Munchkin
Yes. Pages don't have layout.
Just add the "shared" componenets in the layout.
And keep it server sided and whatever needs to be client; make it a separate component. and import it.
Asian black bear
that seems to be the suggested paradigm
making the root layout use client is not usually necessary
Giant pandaOP
Ahh okay, thank you.