Description
svelte-file-dropzone is a Svelte component for file uploads with a drag-and-drop area. The README says it is a Svelte implementation of react-dropzone, and the credit for the design goes to react-dropzone and its authors. The README links a Storybook demo and a set of stories that show the examples. You install the package from npm and use the component in a Svelte file. The props control what the zone accepts and how it behaves. accept sets the allowed file types, using the attr-accept rules the README links. maxSize and minSize set the size limits, with defaults of Infinity and 0. multiple, which defaults to true, allows several files at once. disabled turns the zone off. noClick, noKeyboard and noDrag disable click, keyboard and drag handling. containerClasses and containerStyles style the container, and disableDefaultStyles removes the default styles.…
Highlights
- Svelte drag-and-drop file upload component
- Accept, size and multiple-file props
- Events for accepted and rejected drops
- Storybook demo and examples
Ratings & Reviews
No ratings yet
Be the first to rate svelte-file-dropzone.
People also visit
svelte-file-dropzone FAQ
What is svelte-file-dropzone?
A Svelte component for uploading files with a drag-and-drop zone. The README says it is a Svelte version of react-dropzone.
How do I restrict file types and sizes?
Use the accept prop for file types, and the maxSize and minSize props for sizes.
Can users select several files?
Yes. The multiple prop is true by default, so several files can be selected at once.
Which events does it send?
The README lists dragenter, dragover, dragleave, drop, filedropped, droprejected, dropaccepted and filedialogcancel.
What license is it under?
MIT, as the README states.
What are the best svelte-file-dropzone alternatives?
Popular alternatives to svelte-file-dropzone include react-dropzone, svelte-image-uploader and @files-ui/react. See all svelte-file-dropzone alternatives
















