Node extensions structure
description: You need the foundational nodes required for any Tiptap document: Document, Paragraph, Text.
5.1 Document Structure Nodes
When to Use
You need the foundational nodes required for any Tiptap document: Document, Paragraph, Text.
Items
Document
Description: Root node that wraps all content. Required in every Tiptap editor. Schema:
content: 'block+' // Must contain one or more block nodes
topNode: true // Identifies this as the root
import Document from '@tiptap/extension-document'
new Editor({
extensions: [Document, Paragraph, Text],
})
topNode: true
Paragraph
Description: Basic block-level node for text content. Default block in most editors. Schema:
content: 'inline*' // Zero or more inline nodes (text, marks)
group: 'block' // Part of the block group
import Paragraph from '@tiptap/extension-paragraph'
// Configure default paragraph
Paragraph.configure({
HTMLAttributes: {
class: 'my-paragraph',
},
})
Text
Description: Leaf node representing actual text content. Required for any text editing. Schema:
group: 'inline' // Part of the inline group
import Text from '@tiptap/extension-text'
// Text node is always required, no configuration needed
new Editor({
extensions: [Document, Paragraph, Text],
})
Common Mistakes
- Forgetting to include Document, Paragraph, or Text → Editor won't initialize
- Trying to nest paragraphs inside paragraphs → Invalid schema; use list items for nesting
- Expecting text outside inline context → Text must be inside a node with
content: 'inline*'
See Also
- → 5.2 Content Nodes | Heading, blockquote, code block
- → 3.2 Schema Architecture | Content expression rules
- Reference: https://tiptap.dev/docs/editor/extensions/nodes