react-file-upload-preview
v0.1.5
Published
A powerful React component for previewing uploaded files before they are submitted. Enhance user experience with instant file previews and customizable display options.
Downloads
36
Maintainers
Readme
Note -> Install v0.1.4 or above
Usage
Install
npm install [email protected]
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 |