Skip to content

Commit 8d1f446

Browse files
authored
Merge pull request #15 from Lemoncode/changeset-release/main
Version Packages
2 parents 7e792e3 + 5fd10bd commit 8d1f446

File tree

3 files changed

+60
-58
lines changed

3 files changed

+60
-58
lines changed

.changeset/poor-carpets-know.md

Lines changed: 0 additions & 57 deletions
This file was deleted.
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# @lemoncode/react-image-focal-point
2+
3+
## 1.0.0
4+
5+
### Major Changes
6+
7+
- [#13](https://github.com/Lemoncode/react-image-focal-point/pull/13) [`6154ffa`](https://github.com/Lemoncode/react-image-focal-point/commit/6154ffa419795545eeb33ca5cd24265fb12e5ed6) Thanks [@Nasdan](https://github.com/Nasdan)! - Let the user set the picture focal point just by visually dragging and dropping on top of the selected image.
8+
9+
Install _React Image Focal Point_ using your favorite package manager like [npm](https://www.npmjs.com/):
10+
11+
```bash
12+
npm install @lemoncode/react-image-focal-point
13+
14+
```
15+
16+
or via [yarn](https://classic.yarnpkg.com/lang/en/):
17+
18+
```bash
19+
yarn add @lemoncode/react-image-focal-point
20+
21+
```
22+
23+
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.
24+
25+
Import the library styles and the component:
26+
27+
```jsx
28+
import '@lemoncode/react-image-focal-point/style.css';
29+
import { ImageFocalPoint } from '@lemoncode/react-image-focal-point';
30+
31+
const App = () => {
32+
return (
33+
// Your app code
34+
);
35+
};
36+
37+
```
38+
39+
Then use the component:
40+
41+
```jsx
42+
import '@lemoncode/react-image-focal-point/style.css';
43+
import { ImageFocalPoint } from '@lemoncode/react-image-focal-point';
44+
45+
const App = () => {
46+
return (
47+
<ImageFocalPoint
48+
src="your-image-src" // Same src as <img> HTML element
49+
onChange={focalPoint => {
50+
// Add here your code to do whatever you want to when the user drags on the focal point
51+
}}
52+
/>
53+
);
54+
};
55+
```
56+
57+
Check out our official [documentation](https://lemoncode.github.io/react-image-focal-point)
58+
59+
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).

packages/react-image-focal-point/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lemoncode/react-image-focal-point",
3-
"version": "0.0.0",
3+
"version": "1.0.0",
44
"description": "Image focal point component for React",
55
"private": false,
66
"files": [

0 commit comments

Comments
 (0)