A svelte 3 component that implements a list with animated drag-n-drop functionality.
The SortableList component is a versatile tool that allows users to render a list of items that can be reordered by dragging and dropping. It also implements the FLIP animation for smooth transitions when adding, removing, or reordering items in the list. To use this component, you need to set the list prop and respond to the on:reorder event.
To install the SortableList component, follow these steps:
npm install sortable-list
import SortableList from 'sortable-list';
<SortableList list={myList} on:reorder={handleReorder} />
Make sure to replace myList with the actual list you want to render and handleReorder with the function that will be called when items are reordered.
The SortableList component is a powerful tool that enables users to create dynamic lists with drag and drop functionality. It provides smooth animations and customizable options for list items. By following the installation guide and utilizing the available props and events, developers can easily integrate this component into their projects.