Installation
Basic Usage
Styling the Drag Handle
Configuration Options
() => HTMLElement
required
Function that renders and returns the drag handle element.
ComputePositionConfig
Configuration for position computation using the Floating UI library. See Floating UI documentation for details.Default:Example:
() => VirtualElement | null
Function that returns a virtual element for positioning. Useful when the drag handle needs to be positioned relative to a specific DOM element.
boolean
Whether the drag handle is locked in place and visibility.Default:
falsefunction
Callback function called when a node is hovered over or unhovered.Parameters:
node: The hovered node (or null if unhovered)editor: The editor instance
(e: DragEvent) => void
Callback fired when dragging starts.
(e: DragEvent) => void
Callback fired when dragging ends.
boolean | NestedOptions
Enable drag handles for nested content like list items and blockquotes.Default: With configuration:Nested Options:
falseSimple enable:DragHandleRule[]
Custom rules to determine which nodes are draggable. These run after the default rules.
boolean
Whether to include default rules for common cases like list items.Default:
truestring[]
Restrict nested dragging to specific container types.
'left' | 'right' | 'both' | 'none'
Control when to prefer parent over nested node based on cursor position.
'left'(default): Prefer parent near left/top edges'right': Prefer parent near right/top edges (for RTL)'both': Prefer parent near any horizontal edge'none': Disable edge detection
Commands
command
Lock the drag handle in place and visibility.
command
Unlock the drag handle.
command
Toggle the drag handle lock state.