The Document is like the top level HTML structure of your Next.js application. You can use document to change the default language, set favicon;
Because Document only render on Server side, so it doesn't support event such as onClick....
pages/_document.txs
import { Html, Head, Main, NextScript } from "next/document";
export default function Document() {
return (
<Html lang="en">
<Head>
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22" />
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
)
}