Skip to main content
Adjust spacing between lines for better readability. Control line height for paragraphs and headings. Perfect for improving document readability and meeting formatting requirements.

Use Case

  • Readability - Increase spacing for easier reading
  • Academic requirements - Double spacing for papers and theses
  • Accessibility - Better spacing helps users with dyslexia
  • Design control - Match brand guidelines or style requirements

Options

Configure the extension behavior:
types
Array<string>
default:"['heading','paragraph']"
Block types to add line height support to
defaults
Object
Default configuration
defaults.unit
string
Default unit for line height values

Attributes

Node attributes that can be set and retrieved:
lineHeight
LineHeightValue
Line height value

Commands

setLineHeight

Set line height for blocks
Applies to paragraphs and headings
Example:
editor.commands.setLineHeight(1.5)
editor.commands.setLineHeight('24px')
editor.commands.setLineHeight(2)
Parameters:
lineHeight
LineHeightValue
required
Line height to apply

unsetLineHeight

Remove line height
Reverts to default line spacing
Example:
editor.commands.unsetLineHeight()

Types

LineHeightValue

Line height as number (1.5) or string with unit (‘1.5em’, ‘24px’)

Source Code

I