{"id":20409407,"url":"https://github.com/jsakamoto/toolbelt.blazor.filedropzone","last_synced_at":"2025-07-22T23:33:45.111Z","repository":{"id":40408670,"uuid":"415935913","full_name":"jsakamoto/Toolbelt.Blazor.FileDropZone","owner":"jsakamoto","description":"Surround an \"input type=file\" element by this Blazor component to making a zone that accepts drag and drops files.","archived":false,"fork":false,"pushed_at":"2024-09-11T22:38:35.000Z","size":5918,"stargazers_count":28,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-15T10:21:11.324Z","etag":null,"topics":["blazor","dragdrop","drop","dropfile"],"latest_commit_sha":null,"homepage":"https://jsakamoto.github.io/Toolbelt.Blazor.FileDropZone/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jsakamoto.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"zenodo":null}},"created_at":"2021-10-11T13:21:09.000Z","updated_at":"2025-03-25T04:13:41.000Z","dependencies_parsed_at":"2025-04-12T15:50:35.208Z","dependency_job_id":"46664967-636c-47a7-abba-0dc6bc05abce","html_url":"https://github.com/jsakamoto/Toolbelt.Blazor.FileDropZone","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/jsakamoto/Toolbelt.Blazor.FileDropZone","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsakamoto%2FToolbelt.Blazor.FileDropZone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsakamoto%2FToolbelt.Blazor.FileDropZone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsakamoto%2FToolbelt.Blazor.FileDropZone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsakamoto%2FToolbelt.Blazor.FileDropZone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsakamoto","download_url":"https://codeload.github.com/jsakamoto/Toolbelt.Blazor.FileDropZone/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsakamoto%2FToolbelt.Blazor.FileDropZone/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266590578,"owners_count":23952961,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["blazor","dragdrop","drop","dropfile"],"created_at":"2024-11-15T05:41:31.169Z","updated_at":"2025-07-22T23:33:45.088Z","avatar_url":"https://github.com/jsakamoto.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Blazor File Drop Zone\n\n[![NuGet Package](https://img.shields.io/nuget/v/Toolbelt.Blazor.FileDropZone.svg)](https://www.nuget.org/packages/Toolbelt.Blazor.FileDropZone/) [![Discord](https://img.shields.io/discord/798312431893348414?style=flat\u0026logo=discord\u0026logoColor=white\u0026label=Blazor%20Community\u0026labelColor=5865f2\u0026color=gray)](https://discord.com/channels/798312431893348414/1202165955900473375)\n\n## Summary\n\nSurround an `\u003cinput type=file\u003e` element by this `\u003cFileDropZone\u003e` Blazor component to making a zone that accepts drag and drops files.\n\n- Live demo site - https://jsakamoto.github.io/Toolbelt.Blazor.FileDropZone/\n\n![fig.1](https://raw.githubusercontent.com/jsakamoto/Toolbelt.Blazor.FileDropZone/master/.assets/fig.001.png)\n\n## Usage\n\n**Step 1.** Add the NuGet package of this Blazor component to your Blazor app project.\n\n```shell\n\u003e dotnet add package Toolbelt.Blazor.FileDropZone\n```\n\n\n**Step 2.** Surround `\u003cInputFile\u003e` component by the `\u003cFileDropZone\u003e` component.\n\nBefore:\n\n```html\n\u003c!-- \"Foo.razor\" --\u003e\n\n\u003cInputFile OnChange=\"OnInputFileChange\" /\u003e\n```\n\nAfter:\n\n```html\n\u003c!-- \"Foo.razor\" --\u003e\n\n@using Toolbelt.Blazor.FileDropZone\n...\n\u003cFileDropZone class=\"drop-zone\"\u003e\n\n  \u003cInputFile OnChange=\"OnInputFileChange\" /\u003e\n\n\u003c/FileDropZone\u003e\n```\n\n**Step 3.** Styling the `\u003cFileDropZone\u003e` component as you want to see.\n\n**[Tips]**\n\nThe `\u003cFileDropZone\u003e` component will render just a single \u0026 plain `\u003cdiv\u003e` element outside of child content.\n\nThat means the `\u003cFileDropZone\u003e` component doesn't provide any UI styles.\n\nInstead, `\u003cFileDropZone\u003e` the component adds/removes the `\"hover\"` CSS class to that `\u003cdiv\u003e` element when the mouse cursor enters/leaves the component area.\n\n\n```css\n/* \"Foo.razor.css\" */\n\n::deep .drop-zone {\n    padding: 32px;\n    border: dashed 2px transparent;\n    transition: border linear 0.2s;\n}\n::deep .drop-zone.hover {\n    border: dashed 2px darkorange;\n}\n```\n\nAfter doing the above steps, you will get a drag \u0026 drop file feature like the following image.\n\n![movie](https://raw.githubusercontent.com/jsakamoto/Toolbelt.Blazor.FileDropZone/master/.assets/movie.001.gif)\n\nWhen any files are dropped into the `div` element that the `\u003cFileDropZone\u003e` component rendered, the `\u003cFileDropZone\u003e` component finds a `\u003cinput type=file\u003e` element from an inside of its child content.\n\nAnd then, the component dispatches the file object that the user dropped to the input element that the component found.\n\n## Supported version\n\n- .NET 6 or later is required.\n- Both Blazor WebAssembly and Blazor Server are supported.\n\n## Release Note\n\n[Release notes](https://github.com/jsakamoto/Toolbelt.Blazor.FileDropZone/blob/master/RELEASE-NOTES.txt)\n\n## License\n\n[Mozilla Public License Version 2.0](https://github.com/jsakamoto/Toolbelt.Blazor.FileDropZone/blob/master/LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsakamoto%2Ftoolbelt.blazor.filedropzone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsakamoto%2Ftoolbelt.blazor.filedropzone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsakamoto%2Ftoolbelt.blazor.filedropzone/lists"}