# recrop-element

> React bindings for @github/image-crop-element

Latest version **0.1.2** (published 2022-05-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install recrop-element
pnpm add recrop-element
yarn add recrop-element
bun add recrop-element
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2022-05-01 |
| First published | 2022-04-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 14.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | nemurubaka |
| Maintainers | nemurubaka |
| Keywords | react, component, image, crop |

## Links

- npm: https://www.npmjs.com/package/recrop-element
- Repository: https://github.com/cijiugechu/recrop-element
- Issues: https://github.com/cijiugechu/recrop-element/issues
- npm.io page: https://npm.io/package/recrop-element

## Dependencies (1)

- [@github/image-crop-element](https://npm.io/package/@github/image-crop-element.md) ^5.0.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.2 (latest) — 2022-05-01
- 0.1.1 — 2022-04-28
- 0.1.0 — 2022-04-25
- 0.0.4 — 2022-04-25
- 0.0.3 — 2022-04-25
- 0.0.2 — 2022-04-25
- 0.0.1 — 2022-04-25
- 0.0.0 — 2022-04-25

## README

# recrop-element
React bindings for [image-crop-element](https://github.com/github/image-crop-element).

## Installation
```shell
npm install recrop-element
# or yarn
yarn add recrop-element
# or pnpm
pnpm add recrop-element
```

## Usage

#### Plain
```js
import ReImageCrop from 'recrop-element'

<ReImageCrop src='./your-img.jpg' />
```

#### Rounded crop area
```js
import ReImageCrop from 'recrop-element'

<ReImageCrop src='./your-img.jpg' rounded />
```

#### With loading state
```js
import ReImageCrop from 'recrop-element'

<ReImageCrop src='./your-img.jpg'
             loadingImage='./your-loading-img.jpg' 
/>
```

#### With autoupdate inputs
```js
import ReImageCrop from 'recrop-element'

<ReImageCrop src='./your-img.jpg'
             displayX 
             displayY
             displayWidth
             displayHeight
/>
```

#### Listen to the change event
```js
import ReImageCrop from 'recrop-element'

<ReImageCrop src='./your-img.jpg'
             onImageChange={(event) => {
                 console.log(
                    'Crop area changed.',
                    event.detail.x,
                    event.detail.y,
                    event.detail.width,
                    event.detail.height
                 )
             }}
/>

---
_Source: https://npm.io/package/recrop-element · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
