0

I added the google icon CDN to my _document.js file nextJs project, but still google icons are not working in my project.

```import { Html, Head, Main, NextScript } from "next/document";
   export default function Document() {
   return (
   <Html>
    <Head>
     <link
      href="https://fonts.googleapis.com/icon?family=Material+Icons"
      rel="stylesheet"
     />
    </Head>
     <body>
      <Main />

      <NextScript />
    </body>
  </Html>

); }


 
  • 1
    Check this question https://stackoverflow.com/questions/50303454/how-to-use-the-new-material-design-icon-themes-outlined-rounded-two-tone-and – F KIng Jan 08 '23 at 09:08

1 Answers1

1

Inltall the material-icons library in node

npm i material-icons@latest

Import it to your project

import 'material-icons/iconfont/material-icons.css'

Then you should be able to simply use the <span>icon</span> you need

For more details see https://www.npmjs.com/package/material-icons

Mark
  • 25
  • 4