Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

react-file-upload-preview

A powerful React component for previewing uploaded files before they are submitted. Enhance user experience with instant file previews and customizable display options.

react, react-component, file-upload, file-preview, user-experience, customizable, UI, components, web development, frontend, file display, real-time previews, interactive, enhance engagement, React UI, file handling, web applications, front-end development, UI components, user interface, React library

readme

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

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