项目作者: meowtec

项目描述 :
cropping & rectangle selection component for React
高级语言: TypeScript
项目地址: git://github.com/meowtec/recrop.git
创建时间: 2019-03-05T05:06:11Z
项目社区:https://github.com/meowtec/recrop

开源协议:

下载


recrop

a customizable image-crop / region-selection component for React.

Demo

https://meowtec.github.io/recrop/

Usage

  1. npm i recrop --save
  1. import { ImageCrop } from 'recrop'
  2. class ImageCropApp extends PureComponent {
  3. state = {
  4. crop: null,
  5. }
  6. handleCropChange = (crop) => {
  7. this.setState({ crop })
  8. }
  9. render() {
  10. return (
  11. <div style={{ height: 400, width: 600 }}>
  12. <ImageCrop
  13. crop={this.state.crop}
  14. src="your_image_url"
  15. onChange={this.handleCropChange}
  16. ></ImageCrop>
  17. </div>
  18. )
  19. }
  20. }

Feature

  • Customizable
  • Write in TypeScript

For more usages see demo