next/font

The Next.js font module, which downloads fonts at build time, serves them from your own domain and sets up fallbacks that avoid layout shift.

In more detail

Visitors never contact Google Fonts, which helps privacy and removes a network hop. It generates a fallback font adjusted with size-adjust and preloads the chosen subsets.

Example

import { Inter } from 'next/font/google';
const inter = Inter({ subsets: ['latin'], variable: '--font-inter' });

Related terms

Taught in

References