Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including vue-draggable with all npm packages installed. Try it out:

var vueDraggable = require("vue-draggable")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

vue-draggable v2.0.2

Vue drag and drop library without any dependency

npm version vue2 GitHub open issues buddy pipeline npm download MIT License


Vue Drag and Drop library without any dependency.

Native HTML5 drag and drop implementation made for Vue.

Examples 🎪


npm install vue-draggable
<!-- or -->
yarn add vue-draggable


import Vue from 'vue'
import VueDraggable from 'vue-draggable'



Included TypeScript definitions.

Browser Compatibility

Polyfills for IE9+ support are included in the repo.

If you need to support IE9 in your applications, import the polyfills:

import 'vue-draggable/polyfills'


In the template, use the v-drag-and-drop directive:


<div v-drag-and-drop:options="options">
    <li>Item 1</li>
    <li>Item 2</li>
    <li>Item 3</li>
      <li>Item 4</li>
      <li>Item 5</li>
      <li>Item 6</li>


Directive v-drag-and-drop available options

  dropzoneSelector: 'ul',
  draggableSelector: 'li',
  handlerSelector: null,
  reactivityEnabled: true,
  multipleDropzonesItemsDraggingEnabled: true,
  showDropzoneAreas: true,
  onDrop: function(event) {},
  onDragstart: function(event) {},
  onDragend: function(event) {}

Dropzone events (added, removed, reordered)

<div v-drag-and-drop:options="options">
    <li data-id="1">Item 1</li>
    <li data-id="2">Item 2</li>
    <li data-id="3">Item 3</li>

These three custom events have additional ids and index params. Ids is an array of defined data-id attributes and index represents drop intersection. For more info check out example

Reactivity handling and renderless component

There is available VueDraggableGroup component so you don't need to write your own model manipulation logic. However, usage of this component is optional. Use only with Vue v2.6+

<div v-drag-and-drop:options="options">
  <!-- optional renderless component -->
    v-for="group in groups"
        v-for="item in group.items"
        <label v-text=""></label>

Event Params for onDrop, onDragstart, onDragend callbacks

  nativeEvent: {}, // native js event
  items: [], // list of selected draggable elements
  owner: null, // old dropzone element
  droptarget: null // new dropzone element,
  stop: () => {} // Stop D&D (available only for callbacks `onDragstart` and `onDragend`)

Contributors 🎖


LICENCE MIT - Created by Nikola Spalevic (

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free