Skip to main content

Heading

Below you can view an example of the heading block in JSON format.

{
"type": "heading",
"text": null,
"marks": [],
"content": [
{
"type": "text",
"text": "This is a heading",
"marks": [],
"content": [],
"attrs": {},
"contentHTML": null
}
],
"attrs": {
"align": "left",
"level": 1,
"blockId": "blockId"
},
"contentHTML": "This is heading"
},

Below you can read details about each attribute of the heading block:

type​

A string that represents the type of the block. Heading blocks will always display heading as their type.

text​

A string that represents the text written by the user.

marks​

An array of objects that represents the marks of the block. This value can be something like bold or italic.

content​

An array of objects that represents the content of the block.

attrs​

An object that represents the attributes of the block.

attrs.align​

A string that represents the heading alignment. This value can be left, center, or right.

attrs.blockId​

A string that represents the unique block ID of the heading.

attrs.level​

A number that represents the level of the heading. The values of the heading can be 1, 2, 3, 4, 5, or 6.

contentHTML​

A string that represents the generated HTML of the heading.