Socket
Socket
Sign inDemoInstall

react-image-upload

Package Overview
Dependencies
1
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-image-upload

react library for uploading images


Version published
Maintainers
2
Created

Readme

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

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc