Skip to main content

Overview

Plugins extend the DragDropManager with additional functionality like accessibility, visual feedback, and auto-scrolling. The default preset includes:
  • Accessibility - Screen reader support
  • AutoScroller - Auto-scroll when near edges
  • Cursor - Cursor styling during drag
  • Feedback - Visual drag feedback
  • PreventSelection - Prevent text selection
Additional plugins always included:
  • ScrollListener - Tracks scroll events
  • Scroller - Manages scrolling logic
  • StyleInjector - Injects plugin styles

Accessibility

Provides screen reader announcements and ARIA attributes for drag-and-drop operations.

Options

AccessibilityOptions

Features

The Accessibility plugin automatically:
  • Adds role="button" to draggable elements (if not already a button)
  • Adds aria-roledescription="draggable" attribute
  • Adds aria-describedby pointing to instructions
  • Sets aria-pressed / aria-grabbed to indicate drag state
  • Sets aria-disabled based on draggable state
  • Ensures elements are focusable with tabindex="0"
  • Creates a live region for screen reader announcements

AutoScroller

Automatically scrolls containers when dragging near their edges.

Options

AutoScrollerOptions

Behavior

  • Automatically detects scrollable containers
  • Scrolls when the dragged element is within the threshold zone
  • Scroll speed increases as you get closer to the edge
  • Works with nested scrollable containers
  • Automatically disabled during keyboard dragging

Cursor

Changes the cursor style during drag operations.

Options

CursorOptions

Example

Feedback

Provides visual feedback during drag operations with drag overlays and drop animations.

Options

FeedbackOptions

Feedback Types

Default Feedback

  • Original element hidden with placeholder
  • Element follows cursor
  • Smooth drop animation back to final position

Move Feedback

  • Element itself moves (no clone)
  • No placeholder left behind
  • Good for simple reordering

Clone Feedback

  • Original element stays visible
  • Clone follows cursor
  • Good for copy operations or when source stays visible

No Feedback

  • No visual feedback
  • Useful for custom implementations

Drop Animation

Customize the animation when dropping:

Per-Entity Configuration

Feedback can be configured per draggable:

PreventSelection

Prevents text selection during drag operations.

Usage

No configuration options. Automatically:
  • Applies user-select: none during drag
  • Removes any existing text selection
  • Listens for selection changes and clears them

Scroller

Core scrolling logic used by AutoScroller. Generally used internally.

Usage

ScrollListener

Tracks scroll events for collision detection updates. Always included automatically.

Usage

StyleInjector

Injects CSS for plugins into the document. Always included automatically.

Usage

Example: Custom Plugin Configuration

Example: Minimal Setup

Type Definitions