3.0.1 • Published 1 year ago

react-image-upload v3.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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

3.0.1

1 year ago

3.0.0

1 year ago

2.0.1

2 years ago

2.0.0

2 years ago

1.4.3

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

3 years ago

1.0.3

4 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.1

4 years ago