What is @tiptap/extension-document?
@tiptap/extension-document is an extension for the Tiptap editor, which is a highly customizable rich-text editor framework for the web. This extension provides the basic document structure for Tiptap, allowing you to define the root node of your editor's document schema.
What are @tiptap/extension-document's main functionalities?
Basic Document Structure
This feature allows you to define the basic structure of your document. The 'content' property specifies that the document can contain one or more block elements.
const Document = Document.extend({
content: 'block+',
});
Custom Document Structure
This feature allows you to customize the document structure. In this example, the document must start with a heading followed by one or more block elements.
const CustomDocument = Document.extend({
content: 'heading block+',
});
Other packages similar to @tiptap/extension-document
prosemirror-model
ProseMirror is a toolkit for building rich-text editors on the web. The prosemirror-model package provides a way to define document schemas, similar to @tiptap/extension-document. However, ProseMirror is more low-level and requires more configuration compared to Tiptap.
slate
Slate is another framework for building rich-text editors. It provides a more flexible and customizable approach to defining document structures and content. While Slate offers more control, it also requires more setup and understanding of its API compared to Tiptap.
@tiptap/extension-document
Introduction
tiptap is a headless wrapper around ProseMirror – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as New York Times, The Guardian or Atlassian.
Offical Documentation
Documentation can be found on the tiptap website.
License
tiptap is open-sourced software licensed under the MIT license.