{"id":14962596,"url":"https://github.com/thecodejack/svelte-file-dropzone","last_synced_at":"2025-05-15T03:04:30.081Z","repository":{"id":37079594,"uuid":"273022820","full_name":"thecodejack/svelte-file-dropzone","owner":"thecodejack","description":"Svelte component for fileupload","archived":false,"fork":false,"pushed_at":"2024-10-19T20:43:14.000Z","size":1992,"stargazers_count":270,"open_issues_count":16,"forks_count":48,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-14T00:59:30.376Z","etag":null,"topics":["dropzone","fileupload","svelte3","sveltejs"],"latest_commit_sha":null,"homepage":"https://svelte-file-dropzone.netlify.app/","language":"Svelte","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thecodejack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-06-17T16:18:24.000Z","updated_at":"2025-04-07T08:38:18.000Z","dependencies_parsed_at":"2024-01-19T19:31:30.582Z","dependency_job_id":"087b8d78-234c-4832-b3b4-caeced55130b","html_url":"https://github.com/thecodejack/svelte-file-dropzone","commit_stats":{"total_commits":133,"total_committers":15,"mean_commits":8.866666666666667,"dds":0.6992481203007519,"last_synced_commit":"c30e6ccc5dbf78820d450cc6b485b66ae00e061c"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodejack%2Fsvelte-file-dropzone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodejack%2Fsvelte-file-dropzone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodejack%2Fsvelte-file-dropzone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodejack%2Fsvelte-file-dropzone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thecodejack","download_url":"https://codeload.github.com/thecodejack/svelte-file-dropzone/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248804790,"owners_count":21164132,"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":["dropzone","fileupload","svelte3","sveltejs"],"created_at":"2024-09-24T13:30:07.236Z","updated_at":"2025-04-14T00:59:40.844Z","avatar_url":"https://github.com/thecodejack.png","language":"Svelte","funding_links":[],"categories":["Svelte"],"sub_categories":[],"readme":"# svelte-file-dropzone\r\n\r\n[![NPM](https://img.shields.io/npm/v/svelte-file-dropzone.svg)](https://www.npmjs.com/package/svelte-file-dropzone)\r\n[![npm bundle size (minified + gzip)](https://img.shields.io/bundlephobia/minzip/svelte-file-dropzone.svg)](https://www.npmjs.com/package/svelte-file-dropzone)\r\n\r\nSvelteJS component for file upload and dropzone.The component is Svelte implementation of [react-dropzone](https://github.com/react-dropzone/react-dropzone).\r\n\r\n## Demo\r\n\r\n[Click here for Storybook link](https://svelte-file-dropzone.netlify.app/?path=/info/examples--basic-dropzone)\r\n\r\n## Installation\r\n\r\n```\r\nnpm install svelte-file-dropzone\r\n\r\nor\r\n\r\nyarn add svelte-file-dropzone\r\n```\r\n\r\n## Usage\r\n\r\n```svelte\r\n\u003cscript\u003e\r\n  import Dropzone from \"svelte-file-dropzone\";\r\n\r\n  let files = {\r\n    accepted: [],\r\n    rejected: []\r\n  };\r\n\r\n  function handleFilesSelect(e) {\r\n    const { acceptedFiles, fileRejections } = e.detail;\r\n    files.accepted = [...files.accepted, ...acceptedFiles];\r\n    files.rejected = [...files.rejected, ...fileRejections];\r\n  }\r\n\u003c/script\u003e\r\n\r\n\u003cDropzone on:drop={handleFilesSelect} /\u003e\r\n\u003col\u003e\r\n  {#each files.accepted as item}\r\n    \u003cli\u003e{item.name}\u003c/li\u003e\r\n  {/each}\r\n\u003c/ol\u003e\r\n```\r\n\r\n## API\r\n\r\n### Props\r\n\r\n| Prop Name             | Description                                                                              | Default Value |\r\n| --------------------- | ---------------------------------------------------------------------------------------- | ------------- |\r\n| accept                | Set accepted file types. See https://github.com/okonet/attr-accept for more information. | undefined     |\r\n| disabled              |                                                                                          | false         |\r\n| maxSize               |                                                                                          | Infinity      |\r\n| minSize               |                                                                                          | 0             |\r\n| multiple              | if true, multiple files can be selected at once                                          | true          |\r\n| preventDropOnDocument | 1231                                                                                     | true          |\r\n| noClick               | disable click events                                                                     | false         |\r\n| noKeyboard            | disable keyboard events                                                                  | false         |\r\n| noDrag                | disable drag events                                                                      | false         |\r\n| containerClasses      | custom container classes                                                                 | \"\"            |\r\n| containerStyles       | custom inline container styles                                                           | \"\"            |\r\n| disableDefaultStyles  | don't apply default styles to container                                                  | false         |\r\n| inputElement          | reference to inputElement                                                                | undefined     |\r\n| required              | html5 required attribute added to input                                                  | false         |\r\n\r\n### Events\r\n\r\n| Event Name       | Description | `event.detail` info                    |\r\n| ---------------- | ----------- | -------------------------------------- |\r\n| dragenter        |             | `{dragEvent: event}`                   |\r\n| dragover         |             | `{dragEvent: event}`                   |\r\n| dragleave        |             | `{dragEvent: event}`                   |\r\n| drop             |             | `{acceptedFiles,fileRejections,event}` |\r\n| filedropped      |             | `{event}`                              |\r\n| droprejected     |             | `{fileRejections,event}`               |\r\n| dropaccepted     |             | `{acceptedFiles,event}`                |\r\n| filedialogcancel |             |                                        |\r\n\r\n### Examples\r\n\r\n[Click here](https://github.com/thecodejack/svelte-file-dropzone/tree/master/stories/views) to view stories implementation\r\n\r\n## Credits\r\n\r\nComponent is reimplementation [react-dropzone](https://github.com/react-dropzone/react-dropzone). Complete credit goes to author and contributors of [react-dropzone](https://github.com/react-dropzone/react-dropzone).\r\n\r\n## License\r\n\r\nMIT\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodejack%2Fsvelte-file-dropzone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthecodejack%2Fsvelte-file-dropzone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodejack%2Fsvelte-file-dropzone/lists"}