Rate this page:

Node - heading

Purpose

The heading node represents a heading.

Content

heading is a top-level block node.

Example

1
2
3
4
5
6
7
8
9
10
11
12
{
  "type": "heading",
  "attrs": {
    "level": 1
  },
  "content": [
    {
      "type": "text",
      "text": "Heading 1"
    }
  ]
}

Fields

NameRequiredTypeValue
typestring"heading"
contentarrayArray of zero or more inline nodes
attrsobject
attrs.levelinteger1-6

Content

content takes any inline node.

Attributes

  • level represents the depth of the heading following the same convention as HTML: when level is set to 1 it's the equivalent of <h1>.

Rate this page: