0.1.5 • Published 2 years ago
react-file-upload-preview v0.1.5
Note -> Install v0.1.4 or above
Usage
Install
npm install react-file-upload-preview@0.1.4
Import
import { FileUpload } from 'react-file-upload-preview/dist';
Usage
<FileUpload handleFileUpload={(e)=>console.log(e, event)} accept=".jpg, .png" />
Demo
| prop | type | usage |
|---|---|---|
| handleFileUpload | function | to get the event for the file uploaded |
| inputId | string | input id for your input field |
| accept | string | restrict types of file you want to upload |
| uploadTriggerClasses | string | to add css to upload icon |
| labelContainerClasses | string | to add css to label container |
| customPreviewUrl | string | custom Preview URL |
| customFileType | string | to initialize and prefill the image/video/pdf |
| customUploadIcon | string | custom upload icon URL |