Docs
Soft Break

Soft Break

Insert line breaks within a block of text without starting a new block.

Soft Break ⇧⏎

Customize how soft breaks (line breaks within a paragraph) are handled using configurable rules
hotkey – Use hotkeys like ⇧⏎ to insert a soft break anywhere within a paragraph.
query – Define custom rules to limit soft breaks to specific block types.
Try here ⏎
And here ⏎ as well.


Features

  • Allows insertion of line breaks within a text block without starting a new block.

Installation

npm install @udecode/plate-break

Usage

// ...
import { createSoftBreakPlugin } from '@udecode/plate-break';
 
const plugins = [
  // ...otherPlugins,
  createSoftBreakPlugin({
    options: {
      rules: [
        { hotkey: 'shift+enter' },
        {
          hotkey: 'enter',
          query: {
            allow: [ELEMENT_CODE_BLOCK, ELEMENT_BLOCKQUOTE, ELEMENT_TD],
          },
        },
      ],
    },
  }),
];

Keyboard Interactions

KeyDescription
Shift + Enter

Insert a line break within a block of text without starting a new block.

API

createSoftBreakPlugin

Options

Collapse all

    An array of rule objects specifying the hotkey to activate the soft break and an optional filter query.