---
title: draftMode
description: API Reference for the draftMode function.
url: "https://nextjs.org/docs/14/app/api-reference/functions/draft-mode"
docs_index: /docs/14/llms.txt
version: 14.2.35
lastUpdated: 2023-08-24
prerequisites:
  - "API Reference: /docs/14/app/api-reference"
  - "Functions: /docs/14/app/api-reference/functions"
---


> For an index of all Next.js documentation, see [/docs/14/llms.txt](/docs/14/llms.txt).
The `draftMode` function allows you to detect [Draft Mode](/docs/app/building-your-application/configuring/draft-mode) inside a [Server Component](/docs/app/building-your-application/rendering/server-components).

```jsx filename="app/page.js"
import { draftMode } from 'next/headers'

export default function Page() {
  const { isEnabled } = draftMode()
  return (
    <main>
      <h1>My Blog Post</h1>
      <p>Draft Mode is currently {isEnabled ? 'Enabled' : 'Disabled'}</p>
    </main>
  )
}
```

## Version History

| Version   | Changes                 |
| --------- | ----------------------- |
| `v13.4.0` | `draftMode` introduced. |
---

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