Skip to main content

@lexical/react/LexicalDraggableBlockPlugin

Functions​

DraggableBlockPlugin_EXPERIMENTAL()​

DraggableBlockPlugin_EXPERIMENTAL(__namedParameters): Element

Defined in: packages/lexical-react/src/LexicalDraggableBlockPlugin.tsx:597

Experimental

Renders a draggable handle and drop-target line that let users reorder top-level blocks by dragging. You supply the handle and target-line elements via menuComponent/menuRef and targetLineComponent/targetLineRef, an anchorElem to portal them into (defaults to document.body), and an isOnMenu predicate used to detect interactions with the handle.

The API may change in a future release.

Parameters​

__namedParameters​
anchorElem?​

HTMLElement = document.body

isOnMenu​

(element) => boolean

ReactNode

RefObject<HTMLElement | null>

onElementChanged?​

(element) => void

targetLineComponent​

ReactNode

targetLineRef​

RefObject<HTMLElement | null>

Returns​

Element

A portal containing the drag handle and target line.