Dnd Kit Svelte screenshot

Dnd Kit Svelte

Author Avatar Theme by Hanielu
Updated: 5 Aug 2025
180 Stars

Svelte 5 dnd-kit port

Categories

Overview

The dnd-kit-svelte is an impressive adaptation of the widely used dnd-kit library tailored specifically for Svelte. This toolkit combines the power of the original React implementation with the unique aspects of Svelte’s reactive system, delivering a seamless drag-and-drop experience that is modern, lightweight, and efficient. As developers increasingly seek to create interactive applications, this library stands out by making drag-and-drop functionality more accessible and extensible in Svelte applications.

With full compatibility with the original dnd-kit documentation, users can easily transition or integrate their existing knowledge. The changes facilitate a more Svelte-centric approach to handling reactivity, ensuring that developers can leverage the benefits of both Svelte and dnd-kit seamlessly.

Features

  • Full Feature Parity: Maintains all features present in the original dnd-kit, ensuring no loss of functionality while adapting it for Svelte.

  • Svelte-Specific Adaptations: Modifies APIs to work optimally with Svelte’s reactivity system, catering specifically to Svelte’s unique component behavior.

  • Reactive Value Functions: Allows use of functions for reactive fields in hooks like useSortable and useDraggable, ensuring users always have access to the latest values.

  • Consistent Hook Pattern: Implements a .current getter for certain properties in hooks, such as state values and attributes, to accommodate Svelte’s component reactivity model.

  • Core Concepts Integrated: Retains all foundational concepts from the dnd-kit, including draggable elements, droppable areas, and the DndContext provider, making it familiar for those with experience in the original library.

  • Collision Detection and Modifiers: Offers advanced functionality concerning collision detection and modifiers that enhance the drag-and-drop capabilities significantly.

  • Lightweight and Performant: Prioritizes performance, ensuring that applications using the library remain fast and efficient, even with complex drag-and-drop operations.

  • Accessible Drag-and-Drop Tool: Designed with accessibility in mind, ensuring that the user interface can be navigated and used effectively by all users.