@svforge/dnd
v0.0.1
Published
SVForge Drag & Drop — sortable lists via @thisux/sveltednd
Downloads
31
Maintainers
Readme
@svforge/dnd
Drag & drop sortable lists for SVForge projects. Uses @thisux/sveltednd (native Svelte 5).
Installation
bunx sv add @svforge/dndUsage
<script>
import SortableList from '$lib/components/svforge/dnd/SortableList.svelte';
let items = $state([
{ id: '1', title: 'First item' },
{ id: '2', title: 'Second item' },
{ id: '3', title: 'Third item' },
]);
</script>
<SortableList items={items} onReorder={(newItems) => items = newItems}>
{#snippet children(item)}
<span>{item.title}</span>
{/snippet}
</SortableList>What's included
SortableList.svelte— generic sortable list with drag handles
Dependencies
@thisux/sveltednd— native Svelte 5 drag & drop library@skeletonlabs/skeleton-svelte>= 4.0.0 (peer)
