---
title: forbidden.js
description: API reference for the forbidden.js special file.
url: "https://nextjs.org/docs/15/app/api-reference/file-conventions/forbidden"
docs_index: /docs/15/llms.txt
lastUpdated: 2025-06-16
badge: "Experimental"
prerequisites:
  - "API Reference: /docs/15/app/api-reference"
  - "File-system conventions: /docs/15/app/api-reference/file-conventions"
related:
  - /docs/15/app/api-reference/functions/forbidden
---

> For an index of all documentation, see [/docs/15/llms.txt](/docs/15/llms.txt).

The **forbidden** file is used to render UI when the [`forbidden`](/docs/app/api-reference/functions/forbidden) function is invoked during authentication. Along with allowing you to customize the UI, Next.js will return a `403` status code.

```tsx title="app/forbidden.tsx" 
import Link from 'next/link'

export default function Forbidden() {
  return (
    <div>
      <h2>Forbidden</h2>
      <p>You are not authorized to access this resource.</p>
      <Link href="/">Return Home</Link>
    </div>
  )
}
```

```jsx title="app/forbidden.jsx" 
import Link from 'next/link'

export default function Forbidden() {
  return (
    <div>
      <h2>Forbidden</h2>
      <p>You are not authorized to access this resource.</p>
      <Link href="/">Return Home</Link>
    </div>
  )
}
```

## Reference

### Props

`forbidden.js` components do not accept any props.

## Version History

| Version   | Changes                    |
| --------- | -------------------------- |
| `v15.1.0` | `forbidden.js` introduced. |

---

For a semantic overview of all documentation, see [/sitemap.md](/sitemap.md)

For an index of all available documentation, see [/docs/15/llms.txt](/docs/15/llms.txt)