You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let the user set the picture focal point just by visually dragging and dropping on top of the selected image.
6
+
7
+
Install _React Image Focal Point_ using your favorite package manager like [npm](https://www.npmjs.com/):
8
+
9
+
```bash
10
+
npm install @lemoncode/react-image-focal-point
11
+
12
+
```
13
+
14
+
or via [yarn](https://classic.yarnpkg.com/lang/en/):
15
+
16
+
```bash
17
+
yarn add @lemoncode/react-image-focal-point
18
+
19
+
```
20
+
21
+
This library has `peerDependencies` listings for `react` and `react-dom`. You will need to install these packages in your project in order to use this library.
src="your-image-src"// Same src as <img> HTML element
47
+
onChange={focalPoint=> {
48
+
// Add here your code to do whatever you want to when the user drags on the focal point
49
+
}}
50
+
/>
51
+
);
52
+
};
53
+
```
54
+
55
+
Check out our official [documentation](https://lemoncode.github.io/react-image-focal-point)
56
+
57
+
You'll find runnable examples in the [docs site](https://lemoncode.github.io/react-image-focal-point/docs/examples/basic) and in the [examples folder](https://github.com/Lemoncode/react-image-focal-point/tree/main/examples).
0 commit comments