A generic yet configurable react component for a functioning file upload.
npm install --save @boomi/react-file-upload
import FileUpload from '@boomi/react-file-upload';
<FileUpload />
To contribute to this project you can submit a pull request.
- Clone this repository
npm install
npm link
npm start
Then inside your own local project:
npm link @boomi/react-file-upload
- And follow usage instructions described above
npm run test
This is a unique identifier for this component.
Classes that will be applied to the upper-most div on the component.
This file upload component can accept single or multiple file uploads.
If multiple is true
, then multiple files will be able to be uploaded at a time.
If multiple is false
, then only one file can be uploaded at a time.
Function that performs the file upload.
Caption on the upload button.
Function to be called when an upload is completed. This function is given the response from a successful upload made using the provided upload function.
If this is set to true
, then the upload button will be given a css class to render as a bootstrap small button.
(NOTE: this component doesn't come with bootstrap, you will have to set it up manually)
If this is true
, the upload button will be visible.
If this is false
, the upload button will be hidden.
If the file/s should be instantly uploaded after they are selected.
If set to false
, then an "Upload" button is needed to be pressed to confirm upload.
The text for the label on the upload component.
If set to true
, a red required star will appear on the component.
A message to help users input correct information, only shown when there are no errors.
Whether the entire component is visible or not.
If this component should highlight red to represent a validation error.
A basic string of text to be shown on the drop zone to prompt users to interact with the drop zone.
A permanent help message shown at the bottom of the component.
If the component is set to being disabled, then dropping files onto the drop zone and clicking the upload button will not function.