Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@rpldy/upload-drop-zone

Package Overview
Dependencies
Maintainers
1
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rpldy/upload-drop-zone

drop zone (container) component to initiate file and folder content uploads

  • 0.8.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4K
decreased by-50.84%
Maintainers
1
Weekly downloads
 
Created
Source
npm version circleci status codecov status bundlephobia badge rpldy storybook

Upload Drop Zone

Drop zone (container) component to initiate file and folder content uploads Supports individual files as well as recursively iterating over a dropped directory to upload its contents.

Uses html-dir-content to process the files/directories in the dnd events (DataTransferItem).

Can easily be combined with other D&D solutions.

Drop Zones can use different configuration overrides that supersede the options passed to the parent Uploady.

Note: Some options cannot be overriden by the button. For example, any prop that influences the file input directly (such as 'multiple')

Installation

#Yarn: 
   $ yarn add @rpldy/uploady @rpldy/upload-drop-zone 

#NPM:
   $ npm i @rpldy/uploady @rpldy/upload-drop-zone 

Props

Name (* = mandatory)TypeDefaultDescription
idstringundefinedid attribute to pass to the container element
classNamestringundefinedthe class attribute to pass to the container element
onDragOverClassNamestringundefinedclass name to add to the container when dragged over
dropHandlerDropHandlerMethodundefinedoverride default handler that returns the drop result (ex: files). May return a promise
htmlDirContentParamsObjectundefinedwill be passed as is to html-dir-content. See docs
childrenReact.Nodeundefinedchild element(s) to render inside the container
extraPropsObjectundefinedany other props to pass to the div component (with spread)

In addition, most UploadOptions props can be passed to UploadDropZone. In order to override configuration passed to the parent Uploady component. See Uploady documentation for detailed list of upload options.

Example

Simple example, shows how upload options can be passed to the drop-zone (grouped, maxGroupSize).


import Uploady from "@rpldy/uploady";
import UploadDropZone from "@rpldy/upload-drop-zone";

const App = () => (
    <Uploady destination={destination}>
        <UploadDropZone onDragOverClassName="drag-over"
                        grouped={grouped}
                        maxGroupSize={groupSize}>
            <span>Drag&Drop File(s) Here</span>            
        </UploadDropZone>
    </Uploady>);

See story showing how to use a 3rd library: react-dnd together with @rpldy/upload-drop-zone.

Keywords

FAQs

Package last updated on 09 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc