Skip to main content
Create new
Introduction
Reactivity
Props
Logic
Events
Bindings
Lifecycle
Stores
Motion
Transitions
Animations
Easing
SVG
Actions
Classes
Component composition
Context API
Special elements
Module context
Debugging
7GUIs
Miscellaneous
App.svelte
<script>
import DragDrop from "sveltedragdrop"
let people = [
{ name: "Robert Downey" },
{ name: "Chris Evans" },
{ name: "Chris Hemsworth" },
{ name: "Chadwick Boseman" },
{ name: "Chris Pratt" }
]
function reSortHandler(e) {
let newList = e.detail
people = newList
}
</script>
<svelte:head>
<link rel="stylesheet" href="https://unpkg.com/tailwindcss@2.2.19/dist/tailwind.min.css"/>
<style>
.big-black-text{
color: black;
font-weight: 900;
font-size: 3em;
}
</style>
</svelte:head>

<div>
<DragDrop
let:item
list={people}
on:reSort={reSortHandler}
ulStyle="text-center"
liStyle="big-black-text"
>
<h2>{item.name}</h2>
</DragDrop>
</div>
loading Svelte compiler...
/* Select a component to see its compiled code */
result = svelte.compile(source, {
generate: ,
});
/* Select a component to see its compiled code */