Skip to main content
Create document structure with six heading levels. Use headings to organize content hierarchically. Press Cmd+Option+1-6 for quick heading shortcuts.

OOXML Structure

<w:p>
  <w:pPr>
    <w:pStyle w:val="Heading1"/>
  </w:pPr>
  <w:r>
    <w:t>Heading text</w:t>
  </w:r>
</w:p>

Use Case

  • Document structure - Create logical hierarchy and navigation
  • Accessibility - Screen readers use headings for navigation
  • SEO - Search engines parse heading structure
  • Table of contents - Auto-generate from heading levels

Options

Configure the extension behavior:
levels
Array<number>
default:"[1,2,3,4,5,6]"
Supported heading levels

Attributes

Node attributes that can be set and retrieved:
level
number
required
Heading level (1-6)

Commands

setHeading

Set a heading with specified level
Converts current block to heading
Example:
editor.commands.setHeading({ level: 2 })
Parameters:
attributes
HeadingAttributes
required
Heading attributes including level

toggleHeading

Toggle between heading and paragraph
Switches between heading and paragraph for the same level
Example:
editor.commands.toggleHeading({ level: 1 })
editor.commands.toggleHeading({ level: 3 })
Parameters:
attributes
HeadingAttributes
required
Heading attributes including level

Keyboard Shortcuts

CommandShortcutDescription
toggleHeading()⌘/Ctrl-Alt-1Toggle heading level 1
toggleHeading()⌘/Ctrl-Alt-2Toggle heading level 2
toggleHeading()⌘/Ctrl-Alt-3Toggle heading level 3
toggleHeading()⌘/Ctrl-Alt-4Toggle heading level 4
toggleHeading()⌘/Ctrl-Alt-5Toggle heading level 5
toggleHeading()⌘/Ctrl-Alt-6Toggle heading level 6

Source Code

I