# Image Cropper

## Preview

The component let's user choose an existing image from the image gallery or to take a new one and is able to select an area of that image to pass to your app. Mostly used to take person images for avatar component or similar use cases.

![](/files/-LGjj0Z25XIYUljfQU1-)

## Code sample

```jsx
import { ImageCropper } from '@dormakaba/digital-reactnative-visual';

<ImageCropper onChange={(img) => {}}>
  <Button primary>Take image</Button>
</ImageCropper>
```

The child of the Image cropper can be any component taking an \`onPress\` prop (Buttons,...).

## Props

| **Name** | **Type** | **Description**                                           |
| -------- | -------- | --------------------------------------------------------- |
| onChange | function | returns the image after taken or choosen from the library |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dormakaba-digital.gitbook.io/reactnative-visual/components/image-cropper.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
