⊗jsnxPmLtCt 38 of 57 menu

Site Sections in the Main Layout in NextJS

Let's look at our site layout. Currently, it contains the command to insert the changing page content:

export default function RootLayout({children}) { return ( <html lang="en"> <body> <main> {children} </main> </body> </html> ); }

However, a website usually has other parts that remain unchanged for different pages. For example, these could be the header and footer. Let's add them to our layout:

export default function RootLayout({children}) { return ( <html lang="en"> <body> <header> header </header> <main> {children} </main> <footer> footer </footer> </body> </html> ); }

Add a block with a header, footer, as well as right and left sidebars to your project's layout.

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline