👋 Hello, Next.js with Google Fonts

🔥 Faiday of using next/font/google

  • ✅ Automatic Optimization: Sirf wohi font styles load hongi jo zarurat ho
  • ✅ No FOUT: Flash of Unstyled Text nahi aayega (layout shift avoid)
  • ✅ Self-hosted: Google se direct link nahi, aapki site pe fonts load honge – zyada fast 🚀
  • ✅ Preloading: Fonts jaldi load ho jaate hain – performance better
  • ✅ Asaan Usage: Manually <link> tag dena nahi padta

📌 Kaise Use Kare Google Fonts in Next.js

import { Poppins } from 'next/font/google';

const poppins = Poppins({
  subsets: ['latin'],
  weight: '900',
  display: 'swap',
});

    <div className={$poppins.className min-h-screen bg-gradient-to-br from-gray-100 to-gray-200 p-8}> </div >