# google-font-display

Rule `nextjs/google-font-display`. Enforce font-display behavior with Google Fonts.

- Source: nextjs
- Technologies: Next.js, React
- Kind: correctness
- Needs type information: no
- Autofix: no
- Reach: 130.3M weekly downloads of presets that enable it
- Trend: +60.5% last quarter
- Rank: #127 by reach, #707 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `@next/next/google-font-display` | yes | no | package `@next/eslint-plugin-next` | [docs](https://nextjs.org/docs/messages/google-font-display) |
| Oxlint | `nextjs/google-font-display` | no | no | plugin `nextjs`, category correctness | [docs](https://oxc.rs/docs/guide/usage/linter/rules/nextjs/google-font-display.html) |
| Biome | `suspicious/useGoogleFontDisplay` | yes | no | group suspicious, since 1.9.4 | [docs](https://biomejs.dev/linter/rules/use-google-font-display/) |

## Code examples

### Incorrect: the rule reports this

```jsx
import Head from "next/head";

export default Test = () => {
    return (
        <Head>
            <link
                href="https://fonts.googleapis.com/css2?family=Krona+One"
                rel="stylesheet"
            />
        </Head>
    );
};
```

### Correct: the rule accepts this

```jsx
import Head from "next/head";

export default Test = () => {
    return (
        <Head>
            <link
                href="https://fonts.googleapis.com/css2?family=Krona+One&display=optional"
                rel="stylesheet"
            />
        </Head>
    );
};
```

Examples from the Oxlint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import next from "@next/eslint-plugin-next";

export default [
  {
    plugins: { "@next/next": next },
    rules: {
      "@next/next/google-font-display": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "plugins": [
    "nextjs"
  ],
  "rules": {
    "nextjs/google-font-display": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "suspicious": {
        "useGoogleFontDisplay": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Next.js recommended](https://lintradar.dev/presets/next-recommended.md) | ESLint | `@next/eslint-plugin-next` | 22 | 52.9M | +50.7% |
| [Next.js Core Web Vitals](https://lintradar.dev/presets/next-core-web-vitals.md) | ESLint | `eslint-config-next` | 62 | 46.8M | +48.8% |
| [Biome recommended](https://lintradar.dev/presets/biome-recommended.md) | Biome | `@biomejs/biome` | 491 | 28.5M | +106.8% |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |

## Related rules

- [nextjs/google-font-preconnect](https://lintradar.dev/rules/nextjs/google-font-preconnect.md): Ensure `preconnect` is used with Google Fonts.
- [nextjs/inline-script-id](https://lintradar.dev/rules/nextjs/inline-script-id.md): Enforce `id` attribute on `next/script` components with inline content.
- [nextjs/no-document-import-in-page](https://lintradar.dev/rules/nextjs/no-document-import-in-page.md): Prevent importing `next/document` outside of `pages/_document.js`.
- [nextjs/no-head-element](https://lintradar.dev/rules/nextjs/no-head-element.md): Prevent usage of `<head>` element.
- [nextjs/no-head-import-in-document](https://lintradar.dev/rules/nextjs/no-head-import-in-document.md): Prevent usage of `next/head` in `pages/_document.js`.
- [nextjs/no-img-element](https://lintradar.dev/rules/nextjs/no-img-element.md): Prevent usage of `<img>` element due to slower LCP and higher bandwidth.

---

Web page: https://lintradar.dev/rules/nextjs/google-font-display. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
