Menu
Libraries |
Category

svelte-sortable-list

  • Renders a sortable list with drag-and-drop reordering functionality
  • Implements FLIP animations for smooth transitions when adding/removing/reordering items
  • Built specifically for Svelte framework

Key Features:

  • Requires list prop (array of items) and on:sort event handler
  • Supports both primitive values and objects in lists (requires key prop for objects)
  • Customizable item rendering through slots with access to item and index

Target Audience:
Svelte developers needing interactive, animated sortable lists

Customization:

  • Default renders items as <p> tags
  • Slot allows complete control over item rendering
  • Supports object arrays via key prop for unique identification

Event Handling:

  • on:sort event provides updated list in event.detail

Examples:

  • Basic usage with string array
  • Advanced usage with object array and custom components

Basic Example ↗
Complete Example ↗

svelte

Comments