Next.js Discord

Discord Forum

Make header component appear in all pages

Answered
Cuvier’s Dwarf Caiman posted this in #help-forum
Open in Discord
Cuvier’s Dwarf CaimanOP
hey im new to this and i need help in making my header component appear in all the pages..how do i do that?
Answered by B33fb0n3
you can do that by creating a layout.tsx. Put your header component inside it and every nested page will have this header
View full answer

5 Replies

@Cuvier’s Dwarf Caiman hey im new to this and i need help in making my header component appear in all the pages..how do i do that?
you can do that by creating a layout.tsx. Put your header component inside it and every nested page will have this header
Answer
Cuvier’s Dwarf CaimanOP
the layout.tsx should be inside which folder?
inside your app folder if you using the app router. And then directly next to your page.tsx
Cuvier’s Dwarf CaimanOP
ohk ty it works