Menu
Coddy logo textTech

Step 1: The Shell

Part of the Next.js Essentials section of Coddy's React journey — lesson 39 of 47.

challenge icon

Challenge

Easy

Build the shell in app/layout.jsx.

  1. Import ./globals.css and Link from next/link.
  2. Export metadata with a title object: default of Coddy Eats and template of %s | Coddy Eats.
  3. Inside <body>, add a <nav className="nav"> holding three links: className="brand" to / reading Coddy Eats, id="nav-menu" to / reading Menu, and id="nav-desserts" to /?category=dessert reading Desserts.
  4. Below the nav, wrap {children} in a <div className="container">.

Try it yourself

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

All lessons in Next.js Essentials