https://github.com/nikku/file-drops
A simple in-browser file drop utility.
https://github.com/nikku/file-drops
file-drop
Last synced: 3 months ago
JSON representation
A simple in-browser file drop utility.
- Host: GitHub
- URL: https://github.com/nikku/file-drops
- Owner: nikku
- License: mit
- Created: 2018-09-20T12:14:36.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2025-10-10T12:59:36.000Z (3 months ago)
- Last Synced: 2025-10-12T02:38:47.214Z (3 months ago)
- Topics: file-drop
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/file-drops
- Size: 301 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# file-drops
A simple in-browser file drop utility.
## Usage
```javascript
import fileDrop from 'file-drops';
const element = document.querySelector('#container');
const dropHandler = fileDrop('Drop a file', function(files) {
// files = [ { name, contents }, ... ]
});
element.addEventListener('dragover', dropHandler);
```
## Styling
On drop over, the utility will attach the following overlay to the
element for which the drop handler got registered:
```html
```
Style it as you wish. :heart:
## See also
* [file-open](https://github.com/nikku/file-open) - simple file open utility
## License
MIT