1.1.0 • Published 3 years ago

@tri-bit/drizop v1.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

Drizop

Easy to use file drop for React. Includes list and image gallery modes, file extension filtering and progress bar.

alt text

Images source: Pexels.com

Files can be removed by hovering, and then clicking the 'x' icon:

alt text

Usage

import  Drizop  from '@tri-bit/drizop';

//list mode example with filtered extensions
<Drizop onLoadCallback={handleFileDrop} allowedFileTypes="txt, doc, rtf"/>

//image gallery example with additional props
<Drizop
	mode="image"
	onLoadCallback={handleFileDrop}
	message="Drop your image(s) here"
	fileLimit={3}
	style={{border:"3px solid black"}}
/>

Props

propsdescription
mode"image" or "list" (Default value: "list")
onLoadCallbackUse this callback to send the dropped files to your application (for uploading, etc.) Every time a new file is dropped or a file removed this callback will send the updated file array.
allowedFileTypesa comma seperated string of the allowed extensions (Example: "png, txt, jpg")
clearPreviousOnDropreset the file list on a new file drop (Default value: "false")
progressYou can display upload progress percentage (0-100) Setting above zero will lock file drops / removal.
messageText in the center of component. (Default value: 'Drop File(s) Here')
buttonSet to "true" to add a clickable button to the uploader - uses the browsers file open dialog (Default value: "false")
buttonMessageText inside the optional button (Default value: "Click Here To Upload")
fileLimitSets max number of files allowed (Default value: 8)
stylestyle object applied to Drizop component (Default value: {})

Notes

  • .dmg, .exe, .php extensions are automatically blocked (your backend should still do safety checks on uploaded files just to be safe.)
  • You can use the optional style prop to easily change Drizop's width or border style (and more.)
1.1.0

3 years ago

1.0.409

3 years ago

1.0.407

4 years ago

1.0.404

4 years ago

1.0.406

4 years ago

1.0.405

4 years ago

1.0.403

4 years ago

1.0.401

4 years ago

1.0.4

4 years ago

1.0.351

4 years ago

1.0.34

4 years ago

1.0.33

4 years ago

1.0.32

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.21

4 years ago

1.0.0

4 years ago