Installation
The drop indicator extension is included in theprosekit package.
Usage
This extension is typically used with the
<DropIndicator /> and <BlockHandleDraggable /> components for a complete drag-and-drop experience.API reference
defineDropIndicator()
Creates a drop indicator extension that shows where dragged blocks will be dropped.
With UI components
The drop indicator extension works best with ProseKit’s UI components:How it works
The drop indicator extension:- Tracks drag events within the editor
- Calculates drop position based on cursor location
- Shows visual indicator at the target position
- Handles drop events to move blocks
Use cases
Reorder paragraphs
Drag and drop paragraphs to reorder content
Move headings
Reorganize document structure by moving headings
Rearrange lists
Move list items and nested lists
Position media
Place images and videos precisely
Related
- Block handle - Component for dragging blocks
- Drop cursor - Lower-level alternative