cropping & rectangle selection component for React
a customizable image-crop / region-selection component for React.
https://meowtec.github.io/recrop/
npm i recrop --save
import { ImageCrop } from 'recrop'
class ImageCropApp extends PureComponent {
state = {
crop: null,
}
handleCropChange = (crop) => {
this.setState({ crop })
}
render() {
return (
<div style={{ height: 400, width: 600 }}>
<ImageCrop
crop={this.state.crop}
src="your_image_url"
onChange={this.handleCropChange}
></ImageCrop>
</div>
)
}
}
For more usages see demo