1.0.0-alpha.30 • Published 1 year ago

@talixo/file-input v1.0.0-alpha.30

Weekly downloads
1
License
MIT
Repository
github
Last release
1 year ago

Talixo File Input

UI Component which represents File Input

How to install

Package is available as @talixo/file-input in NPM registry, so you can use it in your project using npm install @talixo/file-input --save or yarn add @talixo/file-input.

Requirements

Your package should additionally have some extra dependencies:

  • @talixo/button: ^1.0.0-alpha.30
  • @talixo/icon: ^1.0.0-alpha.30
  • @talixo/shared: ^1.0.0-alpha.30
  • prop-types: ^15.6.1
  • react: ^16.2.0
  • react-dom: ^16.2.0

These packages are required by @talixo/file-input, but you have to install them manually, to avoid having different versions of these in your application.

Supported props

It allows any props which are allowed for div. Additionally, it handles some differently:

Property nameTypeDefaultDescription
buttonLabelstring'Browse Files'Label of browse file button.
childrennodesn/aContent displayed in drop box.
classNamestringn/aAdditional class name.
dropDisabledbooleanfalseDisable drag and drop.
filesstringn/aDropped files.
renderFilefunctionFileFile component renderer.
multiplebooleantrueAllows multiple files uploading.
uploadLabelnoden/aLabel displayed alongside button.
onChangefunctionn/aonChange callback. Invoked when either files have been dropped or file input has changed.
onRemovefunctionn/aFile onRemove callback.
onDragEndfunctionn/aonDragEnd callback. Applies sent files and event.
onDragEnterfunctionn/aonDragEnter callback. Applies sent files and event.
onDragExitfunctionn/aonDragExit callback. Applies sent files and event.
onDragLeavefunctionn/aonDragLeave callback. Applies sent files and event.
onDragOverfunctionn/aonDragOver callback. Applies sent files and event.
onDragStartfunctionn/aonDragEnd callback. Applies sent files and event.

Changelog

  • 0.1.0 - initial version