Drag and Drop Example

Here you’ll see a demo of how you might set up Drag and Drop with Uppy.

autoProceed is on
autoProceed is off

Console output (latest logs are at the top):

On this page we're using the following HTML snippet:

app.htmlview raw
<!-- Basic Uppy styles -->
<link rel="stylesheet" href="/uppy/uppy.min.css">
<div class="grid">
<div class="column-1-2">
<h5>autoProceed is on</h5>
<!-- Target DOM node #1 -->
<div class="UppyDragDrop-One"></div>
<!-- Progress bar #1 -->
<div class="UppyDragDrop-One-Progress"></div>
</div>
<div class="column-1-2">
<h5>autoProceed is off</h5>
<!-- Target DOM node #2 -->
<div id="UppyDragDrop-Two"></div>
<!-- Progress bar #2 -->
<div class="UppyDragDrop-Two-Progress"></div>
<button class="UppyDragDrop-Two-Upload">Upload</button>
</div>
</div>

Along with this JavaScript:

app.es6view raw
const Uppy = require('uppy/lib/core/Core')
const DragDrop = require('uppy/lib/plugins/DragDrop')
const ProgressBar = require('uppy/lib/plugins/ProgressBar')
const Tus = require('uppy/lib/plugins/Tus')
const uppyOne = new Uppy({debug: true})
uppyOne
.use(DragDrop, {target: '.UppyDragDrop-One'})
.use(Tus, {endpoint: '//master.tus.io/files/'})
.use(ProgressBar, {target: '.UppyDragDrop-One-Progress'})
.run()
const uppyTwo = new Uppy({debug: true, autoProceed: false})
uppyTwo
.use(DragDrop, {target: '#UppyDragDrop-Two'})
.use(Tus, {endpoint: '//master.tus.io/files/'})
.use(ProgressBar, {target: '.UppyDragDrop-Two-Progress'})
.run()
var uploadBtn = document.querySelector('.UppyDragDrop-Two-Upload')
uploadBtn.addEventListener('click', function () {
uppyTwo.upload()
})

Please see documentation for details.

Hey there stranger! Uppy is in the early stages of development and the example section is our playground. Things might not yet work, but we're working hard to improve this.

We're on a monthly release cycle and our latest version is v0.21.0, but the example pages reflect the latest work in our master branch. Here's what changed in master since v0.21.0 in terms of commits, while the CHANGELOG provides a higher level view of this things planned for our next release.

Files from the examples are uploaded to our test servers and deleted daily.