# no-page-custom-font

Rule `nextjs/no-page-custom-font`. Prevent page-only custom fonts.

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

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `@next/next/no-page-custom-font` | yes | no | package `@next/eslint-plugin-next` | [docs](https://nextjs.org/docs/messages/no-page-custom-font) |
| Oxlint | `nextjs/no-page-custom-font` | no | no | plugin `nextjs`, category correctness | [docs](https://oxc.rs/docs/guide/usage/linter/rules/nextjs/no-page-custom-font.html) |

## Code examples

### Incorrect: the rule reports this

```jsx
// pages/index.jsx
import Head from "next/head";
function IndexPage() {
  return (
    <Head>
      <link
        href="https://fonts.googleapis.com/css2?family=Krona+One&display=swap"
        rel="stylesheet"
      />
    </Head>
  );
}
export default IndexPage;
```

### Correct: the rule accepts this

```jsx
// pages/_document.jsx
import NextDocument, { Html, Head } from "next/document";
class Document extends NextDocument {
  render() {
    return (
      <Html>
        <Head>
          <link
            href="https://fonts.googleapis.com/css2?family=Krona+One&display=swap"
            rel="stylesheet"
          />
        </Head>
      </Html>
    );
  }
}
export default Document;
```

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/no-page-custom-font": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "plugins": [
    "nextjs"
  ],
  "rules": {
    "nextjs/no-page-custom-font": "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% |

## Related rules

- [nextjs/no-html-link-for-pages](https://lintradar.dev/rules/nextjs/no-html-link-for-pages.md): Prevent usage of `<a>` elements to navigate to internal Next.js pages.
- [nextjs/no-script-component-in-head](https://lintradar.dev/rules/nextjs/no-script-component-in-head.md): Prevent usage of `next/script` in `next/head` component.
- [nextjs/no-duplicate-head](https://lintradar.dev/rules/nextjs/no-duplicate-head.md): Prevent duplicate usage of `<Head>` in `pages/_document.js`.
- [nextjs/no-styled-jsx-in-document](https://lintradar.dev/rules/nextjs/no-styled-jsx-in-document.md): Prevent usage of `styled-jsx` in `pages/_document.js`.
- [nextjs/no-css-tags](https://lintradar.dev/rules/nextjs/no-css-tags.md): Prevent manual stylesheet tags.
- [nextjs/no-title-in-document-head](https://lintradar.dev/rules/nextjs/no-title-in-document-head.md): Prevent usage of `<title>` with `Head` component from `next/document`.

---

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