New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-image-cropping

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-image-cropping

Image Crop component for React app based on Moveable lib (https://github.com/daybrush/moveable)

latest
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
1
-50%
Maintainers
1
Weekly downloads
 
Created
Source

react-image-crop

Image Crop component for React app based on Moveable

Install

if you use npm

npm install --save react-image-crop

or

yarn add react-image-crop

Usage

import ImageCrop from "react-image-crop";

class MyApp extends React.Component {
    state = { newImage: null }
    
    render () {
        return <ImageCrop 
            canDelete
            className="myapp-image-crop"
            imageUrl={this.state.newImage}
            onChange={({ target }) => this.setState({ newImage: target.result })}
            onDelete={() => this.setState({ newImage: null })}
            onSubmit={() => this.savePhoto()}
        />
    }
}

without photo with photo

Params

NameDefault valueRequiredDescription
onChangefunc: (event) => {}yesevent on change photo
onClosefunc: () => {}nofunction on closing crop
onDeletefunc: () => {}nofunction on delete photo
onSubmitfunc: (event, boundingImageRects) => {}yesfunction on click "submit"
imageUrlstringnoimage path for crop window
canDragbool: truenocan you drag image
canClosebool: falsenocan you close crop
canDeletebool: falsenocan you delete image
classNamestring: nonenoregular className property for react component
closeIconstringnourl of custom close icon
deleteIconstring: nonenourl of custom delete icon
deleteLabelstring: "Delete"nolabel for delete button
isLoadingbool: falsenoflag if you need loading spinner
plugIconstringnoimage if imageUrl is absent
submitLabelstring: "Save"nolabel for submit button
uploadPhotoLabelstring: "Upload photo"nolabel for upload photo button

Using libraries

  • jquery
  • prop-types
  • react-moveable

License

Copyright (c) 2019 Maria Lobareva Licensed under the The MIT License (MIT).

Keywords

image crop

FAQs

Package last updated on 11 Aug 2019

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