Skip to main content
The Solid integration for dnd-kit provides hooks and components that enable drag and drop functionality in SolidJS applications.

Architecture

The Solid integration is built on top of the core @dnd-kit/dom package and provides:
  • Hooks: Reactive hooks that manage drag and drop state
  • Components: Solid components for context and overlay management
  • Type Safety: Full TypeScript support with proper type inference
  • Signals Integration: Deep integration with SolidJS signals and reactivity

Core Concepts

DragDropProvider

The root component that provides drag and drop context to your application:

Hooks

Solid hooks provide reactive drag and drop functionality:
  • useDraggable: Make elements draggable
  • useDroppable: Make elements droppable
  • useSortable: Combine draggable and droppable for sortable items
  • useDragDropMonitor: Listen to drag and drop events
  • useDragOperation: Access the current drag operation state
  • useDragDropManager: Access the drag drop manager instance

Ref-Based Element Attachment

Solid hooks return ref setters for attaching elements:

Installation

Package Exports

Core

  • DragDropProvider - Context provider component
  • DragOverlay - Overlay component for drag preview
  • useDraggable - Draggable hook
  • useDroppable - Droppable hook
  • useDragDropManager - Manager access hook
  • useDragDropMonitor - Event monitoring hook
  • useDragOperation - Drag operation state hook
  • useInstance - Instance creation hook

Sortable

  • useSortable - Sortable item hook
  • isSortable - Type guard for sortable instances
  • isSortableOperation - Type guard for sortable operations

Utilities

  • useDeepSignal - Deep reactivity bridge for signals

Sensors

  • PointerSensor - Mouse and touch input
  • KeyboardSensor - Keyboard navigation

Reactivity Model

The Solid integration uses createEffect to sync reactive properties and createSignal for refs:

Next Steps

Hooks

Detailed reference for all Solid hooks

Quick Start

Get started with Solid integration