3.0.0 • Published 4 years ago

hayer-react-image-crop v3.0.0

Weekly downloads
3
License
ISC
Repository
-
Last release
4 years ago

Hayer React Image Crop

An image cropping tool for React. based on npm package "react-image-crop"

Demo

Installation

npm i hayer-react-image-crop --save

yarn add hayer-react-image-crop --save

Usage

Include the main js module:

import HayerImageCrop from 'hayer-react-image-crop';
import 'hayer-react-image-crop/style.css';

Example

<HayerImageCrop
  onImageCrop={(img) => {console.log(img)}}
  error={(err) => alert(err)}
  aspect={4/4}
  unit="px"
  width={256}
  src="https://pbs.twimg.com/media/DM9sVVUV4AAQ8Bx.jpg"
/>

Props

CommandDescriptionDefault Props
aspectaspect ratio for your image16 / 9
unitcrop property % or px%
widthwidth for crop in px or %30
heightheight for crop in px or %null
srcin src you can pass your existing image src to viewnull
onImageCroponImageCrop() return base64 croped image--
errorerror() throw error if image format is not jpg or png--
3.0.0

4 years ago

2.2.6

5 years ago

2.2.5

5 years ago

2.2.4

5 years ago

2.2.3

5 years ago

2.2.2

5 years ago

2.2.1

5 years ago

2.1.6

5 years ago

2.1.5

5 years ago

2.1.4

5 years ago

2.1.3

5 years ago

2.1.2

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago