Package Exports
- direct-drop-area
- direct-drop-area/es/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (direct-drop-area) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
direct-drop-area
react based component converting the element to a drop zone for file upload or manipulations supporting direct web image drop
Installation
$ git clone https://github.com/sreenathch/direct-drop-area.git
$ cd direct-drop-area
$ yarn installScripts
Running locally
$ yarn startUsage
const acceptedFilesType = 'image/*' // accepted file types
<DirectDropArea
dontRead
accept={acceptedFilesType}
onDrop={(file) => {
console.log(file)
}}
handleClick={false}>
{({ over, overDocument }) => (
<div
style={{
...(over
? { opacity: '50%', border: '1px dashed #259925' }
: {}),
width: '600px',
height: '200px',
display: 'flex',
alignItems: 'center',
justifyContent: 'center'
}}
>this is a drop zone </div>)}
</DirectDropArea>