Skip to content

JSONContent

JSONContent = object

Defined in: node_modules/@tiptap/core/dist/index.d.ts:1429

A Tiptap JSON node or document. Tiptap JSON is the standard format for storing and manipulating Tiptap content. It is equivalent to the JSON representation of a Prosemirror node.

Tiptap JSON documents are trees of nodes. The root node is usually of type doc. Nodes can have other nodes as children. Nodes can also have marks and attributes. Text nodes (nodes with type text) have a text property and no children.

const content: JSONContent = {
type: 'doc',
content: [
{
type: 'paragraph',
content: [
{
type: 'text',
text: 'Hello ',
},
{
type: 'text',
text: 'world',
marks: [{ type: 'bold' }],
},
],
},
],
}

[key: string]: any

optional attrs?: Record<string, any>

Defined in: node_modules/@tiptap/core/dist/index.d.ts:1437

The attributes of the node. Attributes can have any JSON-serializable value.


optional content?: JSONContent[]

Defined in: node_modules/@tiptap/core/dist/index.d.ts:1441

The children of the node. A node can have other nodes as children.


optional marks?: object[]

Defined in: node_modules/@tiptap/core/dist/index.d.ts:1445

A list of marks of the node. Inline nodes can have marks.

[key: string]: any

optional attrs?: Record<string, any>

The attributes of the mark. Attributes can have any JSON-serializable value.

type: string

The type of the mark


optional text?: string

Defined in: node_modules/@tiptap/core/dist/index.d.ts:1462

The text content of the node. This property is only present on text nodes (i.e. nodes with type: 'text').

Text nodes cannot have children, but they can have marks.


optional type?: string

Defined in: node_modules/@tiptap/core/dist/index.d.ts:1433

The type of the node