Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Attach files via drag and drop or file input.

License

NotificationsYou must be signed in to change notification settings

github/file-attachment-element

Repository files navigation

Attach files via drag and drop or file input.

Installation

$ npm install @github/file-attachment-element

Usage

import'@github/file-attachment-element'
<file-attachmentdirectory><inputtype="file"multiple/></file-attachment>

Optional attributes

  • file-attachment[directory] enables traversing directories.
  • file-attachment[input] points to the ID of a file input inside of<file-attachment>. If supplied, only files selected from the corresponding<input> will be attached to<file-attachment>.

Styling drag state

A boolean[hover] attribute is present on<file-attachment> while files are dragged over the element.

file-attachment[hover] {border:2px dashed grey; }

Events

  • file-attachment-accept – Files were dropped onto the element. Callevent.preventDefault() to prevent the drop. Bubbles.
  • file-attachment-accepted – Files were added to the attachment list and can be uploaded by the host app. Bubbles.

Browser support

Browsers without nativecustom element support require apolyfill.

  • Chrome
  • Firefox
  • Safari
  • Microsoft Edge

Development

npm installnpm test

License

Distributed under the MIT license. See LICENSE for details.

About

Attach files via drag and drop or file input.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors15


[8]ページ先頭

©2009-2025 Movatter.jp