Drag & drop
useFileDrop
Turns any element into a drop target for files, with a drag-over state that holds steady over child elements and ignores dragged text or links. Use it to build your own drop zone.
The drag-and-drop half of FileUpload. It makes any element a drop target for files from the desktop, tracks whether a drag is over it, and passes the dropped files to onFiles. It counts nested dragenter and dragleave events, so moving over a child element doesn't flicker the state. It doesn't validate anything: check type, size and count yourself, as FileUpload does with accept, maxSize and maxFiles. It doesn't open a file picker either, so pair it with an <input type="file"> for keyboard and touch users, who can't drag files.
Install
import { useFileDrop } from 'vael-ui'