Using Next/Font

Chris Clark


Chris Clark
//👇 Import Open Sans fontimport { Open_Sans, Roboto, Roboto_Flex } from'next/font/google'
//👇 Configure font objectconstopenSans=Open_Sans({subsets: ['latin'],display:'swap',})
Use it.
<htmllang="en"className={robotoFlex.className}>
https://blog.logrocket.com/next-js-font-optimization-custom-google-fonts/