Skip to main content

Line Height

The Line Height plugin enables support for line height adjustments within your Plate editor.

It allows you to set the line height for selected elements, such as paragraphs or headings, to improve readability and visual presentation.


To apply a custom line height, click within a paragraph or header and use the toolbar button to select and apply the desired line height value.

import React from 'react';
import { LineWeight } from '@styled-icons/material/LineWeight';
import {
} from '@udecode/plate';
import { basicNodesPlugins } from './basic-nodes/basicNodesPlugins';
import { editableProps } from './common/editableProps';
import { plateUI } from './common/plateUI';
import { lineHeightPlugin } from './line-height/lineHeightPlugin';
import { lineHeightValue } from './line-height/lineHeightValue';
import { Toolbar } from './toolbar/Toolbar';
import { createMyPlugins, MyValue } from './typescript/plateTypes';

const plugins = createMyPlugins(
  [...basicNodesPlugins, createLineHeightPlugin(lineHeightPlugin)],
    components: plateUI,

export default () => (
  <PlateProvider<MyValue> plugins={plugins} initialValue={lineHeightValue}>
      <LineHeightToolbarDropdown icon={<LineWeight />} />

    <Plate<MyValue> editableProps={editableProps} />


Follow these steps to integrate the line height plugin into your Plate editor:

  1. Install the required packages:
npm install @udecode/plate
# or
npm install @udecode/plate-line-height
npm install @udecode/plate-ui-line-height
  1. Import the plugin and include it in your plugin list:
import { createLineHeightPlugin } from '@udecode/plate';
const plugins = createPlugins([
// ...otherPlugins,
], {
components: createPlateUI(),

Source Code#