Sign up (with export icon)

DocumentOutlineTableOfContentsConfig

Api-interface iconinterface

The configuration of the table of contents feature.

ClassicEditor
	.create( {
		plugins: [ TableOfContents, /* ... */ ],
		tableOfContents: {
			headings: [ 'heading1', 'heading2' ]
		}
	} )
	.then( /* ... */ )
	.catch( /* ... */ );
Copy code

See all editor options.

Properties

  • Chevron-right icon

    headings : Array<string> | undefined

    An ordered array of model heading element names to include in the table of contents.

    When set, only headings matching these names are rendered in the ToC widget, independently of documentOutline.headings.

    The index of the heading in the array reflects the heading nesting level in the table of contents.

    ClassicEditor
    	.create( {
    		plugins: [ TableOfContents, /* ... */ ],
    		tableOfContents: {
    			headings: [ 'heading1', 'heading2' ]
    		}
    	} )
    	.then( /* ... */ )
    	.catch( /* ... */ );
    
    Copy code

    When not set, the ToC inherits headings from DocumentOutlineUtils (the existing default behavior).