A lightweight, flexible drag and drop library for Svelte 5 applications.
SvelteDnD is a lightweight drag and drop library designed specifically for Svelte 5 applications. This library, built with TypeScript and Svelte’s new runes system, offers developers a seamless way to implement drag-and-drop functionality in their projects.
use:draggable
and specify container ID and data to transfer.use:droppable
and handle drops via callbacks, with visual feedback during drag operations.dndState
store with automatic cleanup and memory management.To install SvelteDnD, you can follow these steps:
npm install svelte-dnd
Then, import the library in your Svelte component:
import { draggable, droppable } from 'svelte-dnd';
SvelteDnD provides a straightforward solution for adding drag-and-drop functionality to Svelte 5 applications. With intuitive API design, TypeScript support, and performance tips, developers can easily create interactive interfaces without the hassle of complex configurations. Whether it’s basic list interactions or more advanced features like nested containers, this library offers a versatile solution for handling drag-and-drop interactions in Svelte projects.