{"id":15495678,"url":"https://github.com/probablykasper/svelte-droplet","last_synced_at":"2025-04-13T11:08:43.070Z","repository":{"id":57689454,"uuid":"473392339","full_name":"probablykasper/svelte-droplet","owner":"probablykasper","description":"File dropzone for Svelte","archived":false,"fork":false,"pushed_at":"2024-10-23T05:24:47.000Z","size":231,"stargazers_count":35,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-13T11:08:28.222Z","etag":null,"topics":["file-drop","svelte","typescript"],"latest_commit_sha":null,"homepage":"https://svelte-droplet.kasper.space","language":"Svelte","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/probablykasper.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-23T23:34:12.000Z","updated_at":"2025-03-16T22:05:51.000Z","dependencies_parsed_at":"2023-12-19T08:37:29.616Z","dependency_job_id":"e1f4f1fe-456d-4c69-9e55-c989ed01ed08","html_url":"https://github.com/probablykasper/svelte-droplet","commit_stats":{"total_commits":33,"total_committers":1,"mean_commits":33.0,"dds":0.0,"last_synced_commit":"552ac46e9bcdf69897f24526b2680bc6289df0aa"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/probablykasper%2Fsvelte-droplet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/probablykasper%2Fsvelte-droplet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/probablykasper%2Fsvelte-droplet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/probablykasper%2Fsvelte-droplet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/probablykasper","download_url":"https://codeload.github.com/probablykasper/svelte-droplet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248703198,"owners_count":21148118,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["file-drop","svelte","typescript"],"created_at":"2024-10-02T08:18:30.345Z","updated_at":"2025-04-13T11:08:43.042Z","avatar_url":"https://github.com/probablykasper.png","language":"Svelte","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Svelte Droplet\n\n[![NPM](https://img.shields.io/npm/v/svelte-droplet.svg)](https://npmjs.com/package/svelte-droplet)\n[![License](https://img.shields.io/npm/l/svelte-droplet.svg)](LICENSE)\n[![NPM Downloads](https://img.shields.io/npm/dm/svelte-droplet.svg)](https://npmjs.com/package/svelte-droplet)\n[![test](https://github.com/probablykasper/svelte-droplet/actions/workflows/test.yml/badge.svg)](https://github.com/probablykasper/svelte-droplet/actions/workflows/test.yml)\n\nFile dropzone for Svelte\n\n[REPL](https://svelte.dev/repl/961863cf346c474888b658b98dcbf287?version=3.46.4)\n\n## Install\n\n```\nnpm install svelte-droplet\n```\n\n## Usage\n\n```svelte\n\u003cscript lang=\"ts\"\u003e\n\timport { FileDrop } from 'svelte-droplet'\n\tfunction handleFiles(files: File[]) {\n\t\tfor (const file of files) {\n\t\t\tconsole.log(file.name)\n\t\t}\n\t}\n\u003c/script\u003e\n\u003cFileDrop {handleFiles} let:droppable\u003e\n\t\u003cdiv class=\"zone\" class:droppable\u003eSelect or drop files here\u003c/div\u003e\n\u003c/FileDrop\u003e\n```\n\n## Props\n| Prop            | Type                    | Description           |\n| :-------------- | :---------------        | :-------------------- |\n| `handleFiles`   | (files: File[]) =\u003e void | File handler function |\n| `acceptedMimes` | string[] \\| null        | List of allowed MIME types, like `image/jpeg` or `image/*`. Invalid files are ignored.\u003cbr\u003eYou 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.\u003cbr\u003eDefaults to `null` (all are allowed) |\n| `max`           | number \\| null          | Max number of files allowed. Extra files are ignored. Defaults to 0 (no limit) |\n| `disabled`      | boolean                 | Disables the component |\n| `name`          | string \\| null          | Name of the input field, useful for forms |\n| `tabindex`      | number                  | Set a custom tabindex |\n\n## Slot props\n| Prop         | Type     | Description   |\n| :----------- | :------- | :------------ |\n| `droppable`  | boolean  | True if the dropzone is currently hovered with valid files |\n\n## Dev instructions\n\n### Get started\n\n1. Install Node.js (v14 works)\n2. Run `npm install`\n\n### Commands\n\n- `npm run dev`: Start in dev mode\n- `npm run build`: Build\n- `npm run preview`: Preview production app\n- `npm run lint`: Lint\n- `npm run format`: Format\n\n### Publish new version\n\n1. Update `CHANGELOG.md`\n2. Check for errors\n\t```\n\tnpm run lint\n\t```\n3. Bump the version number\n\t```\n\tnpm version --no-git-tag \u003cversion\u003e\n\t```\n4. Generate the package\n\t```\n\tnpm run package\n\t```\n5. Publish the package\n\t```\n\tnpm publish\n\t```\n6. Commit with a tag in format \"v#.#.#\"\n7. Create GitHub release with release notes\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprobablykasper%2Fsvelte-droplet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprobablykasper%2Fsvelte-droplet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprobablykasper%2Fsvelte-droplet/lists"}