{"id":15048063,"url":"https://github.com/github/file-attachment-element","last_synced_at":"2025-05-16T11:03:57.918Z","repository":{"id":37541012,"uuid":"232426962","full_name":"github/file-attachment-element","owner":"github","description":"Attach files via drag and drop or file input.","archived":false,"fork":false,"pushed_at":"2024-12-06T20:36:56.000Z","size":303,"stargazers_count":122,"open_issues_count":3,"forks_count":19,"subscribers_count":255,"default_branch":"main","last_synced_at":"2025-04-09T08:01:40.291Z","etag":null,"topics":["custom-elements","keep","web-components"],"latest_commit_sha":null,"homepage":"https://github.github.com/file-attachment-element/examples/","language":"TypeScript","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/github.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-07T22:10:59.000Z","updated_at":"2025-02-15T11:30:46.000Z","dependencies_parsed_at":"2024-12-15T17:05:53.485Z","dependency_job_id":"4179d43a-b88a-4bca-9466-4aab16d109e1","html_url":"https://github.com/github/file-attachment-element","commit_stats":{"total_commits":65,"total_committers":11,"mean_commits":5.909090909090909,"dds":0.6461538461538461,"last_synced_commit":"434e186effcf398d8896b8b974121bb696c4beae"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Ffile-attachment-element","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Ffile-attachment-element/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Ffile-attachment-element/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Ffile-attachment-element/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/github","download_url":"https://codeload.github.com/github/file-attachment-element/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254514652,"owners_count":22083811,"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":["custom-elements","keep","web-components"],"created_at":"2024-09-24T21:07:36.129Z","updated_at":"2025-05-16T11:03:57.898Z","avatar_url":"https://github.com/github.png","language":"TypeScript","readme":"# \u0026lt;file-attachment\u0026gt; element\n\nAttach files via drag and drop or file input.\n\n## Installation\n\n```\n$ npm install @github/file-attachment-element\n```\n\n## Usage\n\n```js\nimport '@github/file-attachment-element'\n```\n\n```html\n\u003cfile-attachment directory\u003e\n  \u003cinput type=\"file\" multiple /\u003e\n\u003c/file-attachment\u003e\n```\n\n### Optional attributes\n\n- `file-attachment[directory]` enables traversing directories.\n- `file-attachment[input]` points to the ID of a file input inside of `\u003cfile-attachment\u003e`. If supplied, only files selected from the corresponding `\u003cinput\u003e` will be attached to `\u003cfile-attachment\u003e`.\n\n### Styling drag state\n\nA boolean `[hover]` attribute is present on `\u003cfile-attachment\u003e` while files are dragged over the element.\n\n```css\nfile-attachment[hover] { border: 2px dashed grey; }\n```\n\n### Events\n\n- `file-attachment-accept` – Files were dropped onto the element. Call `event.preventDefault()` to prevent the drop. Bubbles.\n- `file-attachment-accepted` – Files were added to the attachment list and can be uploaded by the host app. Bubbles.\n\n## Browser support\n\nBrowsers without native [custom element support][support] require a [polyfill][].\n\n- Chrome\n- Firefox\n- Safari\n- Microsoft Edge\n\n[support]: https://caniuse.com/#feat=custom-elementsv1\n[polyfill]: https://github.com/webcomponents/custom-elements\n\n## Development\n\n```\nnpm install\nnpm test\n```\n\n## License\n\nDistributed under the MIT license. See LICENSE for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub%2Ffile-attachment-element","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgithub%2Ffile-attachment-element","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub%2Ffile-attachment-element/lists"}