nextjs set title webpage

nextjs

To set the title of a webpage in a Next.js application, you can use the Head component from the next/head module.

Here is an example of how to use the Head component to set the title of a webpage:

import Head from 'next/head';

function MyPage() {
  return (
    <div>
      <Head>
        <title>My Page Title</title>
      </Head>
      {/* page content goes here */}
    </div>
  );
}

The title element inside the Head component sets the title of the webpage.

You can also include other elements inside the Head component to set metadata for the webpage, such as the description and keywords meta tags.