Docs
Drag & Drop

Drag & Drop

Allows movement of blocks, such as paragraph or tables, within the editor.

Loading...

Features

  • Drag & drop of blocks for content movement and insertion within the editor.

Installation

npm install @udecode/plate-dnd @udecode/plate-node-id react-dnd react-dnd-html5-backend

Usage

import { createDndPlugin } from '@udecode/plate-dnd';
import { createNodeIdPlugin } from '@udecode/plate-node-id';
 
const plugins = [
  // ...otherPlugins,
  createNodeIdPlugin(),
  createDndPlugin(),
];

Then, wrap your plugin components with Draggable.

API

createDndPlugin

Attributes

Collapse all

    Enables the scroller feature.

    Props for the Scroller component.

focusBlockStartById

getBlocksWithId

selectBlockById

API Plugins

withDraggable

API Components

DndScroller

dndStore

useDndBlock

useDndNode

useDragBlock

useDragNode

useDraggable

useDraggableState

useDropBlock

useDropNode