0.1.5 • Published 9 months ago

react-file-upload-preview v0.1.5

Weekly downloads
-
License
-
Repository
-
Last release
9 months ago

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

Demo Image

proptypeusage
handleFileUploadfunctionto get the event for the file uploaded
inputIdstringinput id for your input field
acceptstringrestrict types of file you want to upload
uploadTriggerClassesstringto add css to upload icon
labelContainerClassesstringto add css to label container
customPreviewUrlstringcustom Preview URL
customFileTypestringto initialize and prefill the image/video/pdf
customUploadIconstringcustom upload icon URL