mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-14 02:09:01 +08:00
4.4 KiB
4.4 KiB
Nodes
toc
Introduction
Nodes add new capabilities to tiptap. Nodes are like block types, for example a paragraph, heading, or code block.
List of supported nodes
Title | Default Extension | Source Code |
---|---|---|
Blockquote | Yes | GitHub |
BulletList | Yes | GitHub |
CodeBlock | Yes | GitHub |
Document | Yes | GitHub |
Emoji | – | GitHub |
HardBreak | Yes | GitHub |
Hashtag | – | GitHub |
Heading | Yes | GitHub |
HorizontalRule | – | GitHub |
Image | – | GitHub |
ListItem | Yes | GitHub |
Mention | Yes | GitHub |
OrderedList | Yes | GitHub |
Paragraph | Yes | GitHub |
Table | – | GitHub |
TableRow | – | GitHub |
TableCell | – | GitHub |
TaskList | – | GitHub |
TaskItem | – | GitHub |
Text | Yes | GitHub |
Create a new node
You’re free to create your own nodes for tiptap. Here is the boilerplate code that’s need to create and register your own node:
import { Node } from '@tiptap/core'
const CustomNode = Node.create({
// Your code here
})
const editor = new Editor({
extensions: [
// Register your custom node with the editor.
CustomNode,
// … and don’t forget all other extensions.
Document,
Paragraph,
Text,
// …
],