Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-image-upload

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-image-upload

react library for uploading images

  • 3.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
276
decreased by-51.66%
Maintainers
2
Weekly downloads
 
Created
Source

react-image-upload

A react library for uploading image. Demo

NPM JavaScript Style Guide

Install

npm install --save react-image-upload

Examples

import ImageUploader from 'react-image-upload'
import 'react-image-upload/dist/index.css'

const App = () => {
  function getImageFileObject(imageFile) {
    console.log({ imageFile })
  }

  function runAfterImageDelete(file) {
    console.log({ file })
  }

  return (
    <ImageUploader
      onFileAdded={(img) => getImageFileObject(img)}
      onFileRemoved={(img) => runAfterImageDelete(img)}
    />
  )
}

export default App

Adding props

<ImageUploader
  style={{ height: 200, width: 200, background: 'rgb(0 182 255)' }}
  deleteIcon={<RiDeleteRow />}
  uploadIcon={<BsCamera />}
/>

Props

PropertyTypeDefaultDescription
styleobjoptionalWrite your custom css
deleteIconeleoptionalThe icon used to delete file
uploadIconeleoptionalThe icon used to upload file
onFileAddedfuncrequiredA function that runs after file has been uploaded and returns the uploaded file
onFileRemovedfuncoptionalA function that runs after file has been removed and returns the removed file

License

MIT © chimdie

Keywords

FAQs

Package last updated on 10 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc