
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
svelte-file-dropzone
Advanced tools
SvelteJS component for file upload and dropzone.The component is Svelte implementation of react-dropzone.
npm install svelte-file-dropzone
or
yarn add svelte-file-dropzone
<script>
import Dropzone from "svelte-file-dropzone/Dropzone.svelte";
let files = {
accepted: [],
rejected: []
};
function handleFilesSelect(e) {
const { acceptedFiles, fileRejections } = e.detail;
files.accepted = [...files.accepted, ...acceptedFiles];
files.rejected = [...files.rejected, ...fileRejections];
}
</script>
<Dropzone on:drop={handleFilesSelect} />
<ol>
{#each files.accepted as item}
<li>{item.name}</li>
{/each}
</ol>
Prop Name | Description | Default Value |
---|---|---|
accept | Set accepted file types. See https://github.com/okonet/attr-accept for more information. | undefined |
disabled | false | |
maxSize | Infinity | |
minSize | 0 | |
multiple | if true, multiple files can be selected at once | true |
preventDropOnDocument | 1231 | true |
noClick | disable click events | false |
noKeyboard | disable keyboard events | false |
noDrag | disable drag events | false |
containerClasses | custom container classes | "" |
containerStyles | custom inline container styles | "" |
disableDefaultStyles | don't apply default styles to container | false |
inputElement | reference to inputElement | undefined |
required | html5 required attribute added to input | false |
Event Name | Description | event.detail info |
---|---|---|
dragenter | {dragEvent: event} | |
dragover | {dragEvent: event} | |
dragleave | {dragEvent: event} | |
drop | {acceptedFiles,fileRejections,event} | |
filedropped | {event} | |
droprejected | {fileRejections,event} | |
dropaccepted | {acceptedFiles,event} | |
filedialogcancel |
Click here to view stories implementation
Component is reimplementation react-dropzone. Complete credit goes to author and contributors of react-dropzone.
MIT
FAQs
Svelte component for fileupload and file dropzone
The npm package svelte-file-dropzone receives a total of 7,701 weekly downloads. As such, svelte-file-dropzone popularity was classified as popular.
We found that svelte-file-dropzone demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.