Skip to main content
The Document extension provides the root node of your editor. Every Tiptap editor requires a document node as the top-level container for all other content.

Installation

npm install @tiptap/extension-document

Usage

The Document extension is included in the StarterKit by default. If you’re building a custom editor, you’ll need to register it:
import { Editor } from '@tiptap/core'
import Document from '@tiptap/extension-document'
import Paragraph from '@tiptap/extension-paragraph'
import Text from '@tiptap/extension-text'

const editor = new Editor({
  extensions: [
    Document,
    Paragraph,
    Text,
  ],
})

Configuration

The Document extension has no configuration options. It serves as the root container and requires at least one block-level node as content.

Schema

The Document node has the following properties:
  • Name: doc
  • Content: block+ (one or more block-level nodes)
  • Top Node: true (this is the root node)

Source Code

View the source code on GitHub: packages/extension-document/src/document.ts

Build docs developers (and LLMs) love