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

Why you’d use this

  • 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:"''"
Default unit for line height values
Usage:
LineHeight.configure({
  resizable: false,
  cellMinWidth: 50
})

Attributes

lineHeight
LineHeightValue
Line height value

Commands

setLineHeight

Set line height for blocks
Applies to paragraphs and headings
// Set to 1.5x spacing
setLineHeight(1.5)

// Set to 24px spacing
setLineHeight('24px')

// Set to double spacing
setLineHeight(2)
Parameters:
lineHeight
LineHeightValue
required
See LineHeightValue type definition

unsetLineHeight

Remove line height
Reverts to default line spacing
unsetLineHeight()

Types

LineHeightValue

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