Last updated on May 20, 2021 by Suraj Sharma
In this tutorial, you’ll learn how you can add a favicon (.ico) image or a shortcut icon to your Next.js application
Skip this section If you have already generated a favicon.
You can generate a favicon from a .png
or a .gpg
file using any online favicon generator websites, like favicon.io
First, place the favicon inside the /public
folder and then add the following code in your /pages/_document.ts
file.
return (
<html lang="en">
<Head>
<link rel="shortcut icon" href="/favicon.ico" />
</Head>
<body>
</body>
</html>
)
Related Solutions
Rate this post
Suraj Sharma is the founder of Future Gen AI Services. He holds a B.Tech degree in Computer Science & Engineering from NIT Rourkela.