Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
svelte-droplet
Advanced tools
File dropzone for Svelte
npm install svelte-droplet
<script lang="ts">
import { FileDrop } from 'svelte-droplet'
function handleFiles(files: File[]) {
for (const file of files) {
console.log(file.name)
}
}
</script>
<FileDrop {handleFiles} let:droppable>
<div class="zone" class:droppable>Select or drop files here</div>
</FileDrop>
Prop | Type | Description |
---|---|---|
handleFiles | (files: File[]) => void | File handler function |
acceptedMimes | string[] | null | List of allowed MIME types, like image/jpeg or image/* . Invalid files are ignored.You can also use file extensions like .jpg but it will not enable droppable when the file is hovering, meaning you can't display a hover effect.Defaults to null (all are allowed) |
max | number | null | Max number of files allowed. Extra files are ignored. Defaults to 0 (no limit) |
disabled | boolean | Disables the component |
name | string | null | Name of the input field, useful for forms |
tabindex | number | Set a custom tabindex |
Prop | Type | Description |
---|---|---|
droppable | boolean | True if the dropzone is currently hovered with valid files |
npm install
npm run dev
: Start in dev modenpm run build
: Buildnpm run preview
: Preview production appnpm run lint
: Lintnpm run format
: FormatCHANGELOG.md
npm run lint
npm version --no-git-tag <version>
npm run package
npm publish
FAQs
File dropzone for Svelte
The npm package svelte-droplet receives a total of 149 weekly downloads. As such, svelte-droplet popularity was classified as not popular.
We found that svelte-droplet 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
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.