Summarize your post with a list of headings. Add HTML anchors to Heading blocks to link them here.
This block is experimental and only available with the Gutenberg plugin.
Category: Design
For developers
Block Grammar & Markup
<!-- wp:table-of-contents {"headings":[{"content":"Heading text","level":2,"link":"#heading-id-1"},{"content":"A sub-heading","level":3,"link":"#heading-id-2"}]} -->
<nav class="wp-block-table-of-contents"><ol><li><a class="wp-block-table-of-contents__entry" href="#heading-id-1">Heading text</a><ol><li><a class="wp-block-table-of-contents__entry" href="#heading-id-2">A sub-heading</a></li></ol></li></ol></nav>
<!-- /wp:table-of-contents -->
Block Attributes
Optional. Type: Object.
Attributes provide the structured data needs of a block. They can exist in different forms when they are serialized, but they are declared together under a common interface.
{
"headings": {
"type": "array",
"items": {
"type": "object"
}
},
"onlyIncludeCurrentPage": {
"type": "boolean",
"default": false
}
}
Block Supports
Optional. Type: Object.
A set of options that enables or disables block controls in the editor, for example gradient colors or padding.
color: background, color: gradients, color: link, color: text, spacing: margin, spacing: padding, typography: __experimentalFontFamily, typography: __experimentalFontStyle, typography: __experimentalFontWeight, typography: __experimentalLetterSpacing, typography: __experimentalTextDecoration, typography: __experimentalTextTransform, typography: fontSize, typography: lineHeight
{
"html": false,
"color": {
"text": true,
"background": true,
"gradients": true,
"link": true
},
"spacing": {
"margin": true,
"padding": true
},
"typography": {
"fontSize": true,
"lineHeight": true,
"__experimentalFontFamily": true,
"__experimentalFontWeight": true,
"__experimentalFontStyle": true,
"__experimentalTextTransform": true,
"__experimentalTextDecoration": true,
"__experimentalLetterSpacing": true,
"__experimentalDefaultControls": {
"fontSize": true
}
}
}