Skip to content

Commit a5989aa

Browse files
committed
update readme
1 parent 4b42cc2 commit a5989aa

File tree

2 files changed

+108
-3
lines changed

2 files changed

+108
-3
lines changed

README.md

Lines changed: 106 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
<br/>
1414

15+
<h2>Live Demo</h2>
16+
<br/>
1517
<a target="_blank" href="https://stackblitz.com/github/Lemoncode/react-image-focal-point/tree/main/examples/basic">
1618
<img
1719
src="https://developer.stackblitz.com/img/open_in_stackblitz.svg"
@@ -27,10 +29,112 @@
2729
height="36"
2830
/>
2931
</a>
30-
</div>
32+
33+
<br />
3134

3235
<hr />
3336

37+
<br />
38+
3439
Video tutorial comming soon
3540

36-
[![Code Coverage][coverage-badge]][coverage]
41+
<br />
42+
43+
</div>
44+
45+
<hr />
46+
47+
48+
<!-- https://github.com/badges/shields -->
49+
50+
![npm](https://img.shields.io/npm/v/@lemoncode/react-image-focal-point?style=plastic) ![npm bundle size](https://img.shields.io/bundlephobia/min/@lemoncode/react-image-focal-point?style=plastic) ![npm downloads](https://img.shields.io/npm/dw/@lemoncode/react-image-focal-point?style=plastic) ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/lemoncode/react-image-focal-point/ci.yml?branch=develop&style=plastic)
51+
52+
![GitHub license](https://img.shields.io/github/license/lemoncode/react-image-focal-point?style=plastic) ![GitHub issues](https://img.shields.io/github/issues/lemoncode/react-image-focal-point?style=plastic) ![GitHub pull requests](https://img.shields.io/github/issues-pr/lemoncode/react-image-focal-point?style=plastic) ![GitHub last commit](https://img.shields.io/github/last-commit/lemoncode/react-image-focal-point?style=plastic)
53+
54+
![GitHub stars](https://img.shields.io/github/stars/lemoncode/react-image-focal-point?style=social) ![GitHub watchers](https://img.shields.io/github/watchers/lemoncode/react-image-focal-point?style=social) ![Twitter Follow](https://img.shields.io/twitter/follow/lemoncoders?style=social)
55+
56+
## Table of Contents
57+
58+
- [Installation](#installation)
59+
- [Quickstart](#quickstart)
60+
- [Docs](#docs)
61+
- [Examples](#examples)
62+
- [Key Features](#key-features)
63+
64+
## Installation
65+
66+
Install _React Image Focal Point_ using your favorite package manager like [npm](https://www.npmjs.com/):
67+
68+
```bash
69+
npm install @lemoncode/react-image-focal-point
70+
71+
```
72+
73+
or via [yarn](https://classic.yarnpkg.com/lang/en/):
74+
75+
```bash
76+
yarn add @lemoncode/react-image-focal-point
77+
78+
```
79+
80+
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.
81+
82+
## Quickstart
83+
84+
Import the library styles and the component:
85+
86+
```jsx
87+
import '@lemoncode/react-image-focal-point/style.css';
88+
import { ImageFocalPoint } from '@lemoncode/react-image-focal-point';
89+
90+
const App = () => {
91+
return (
92+
// Your app code
93+
);
94+
};
95+
96+
```
97+
98+
Then use the component:
99+
100+
```jsx
101+
import '@lemoncode/react-image-focal-point/style.css';
102+
import { ImageFocalPoint } from '@lemoncode/react-image-focal-point';
103+
104+
const App = () => {
105+
return (
106+
<ImageFocalPoint
107+
src="your-image-src" // Same src as <img> HTML element
108+
onChange={focalPoint => {
109+
// Add here your code to do whatever you want to when the user drags on the focal point
110+
}}
111+
/>
112+
);
113+
};
114+
```
115+
116+
## Docs
117+
118+
Check out our official [documentation](https://lemoncode.github.io/react-image-focal-point)
119+
120+
## Examples
121+
122+
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).
123+
124+
## Key Features
125+
126+
- You can just drag and drop a focal point button on top of your image and enhance your cropped images.
127+
128+
- You can use it as a controlled or uncontrolled component.
129+
130+
- You can style the component at any component's level (check out the [docs site CSS section](https://lemoncode.github.io/react-image-focal-point/docs/api/image-focal-point#classesprops)).
131+
132+
# About Lemoncode + Basefactor
133+
134+
We are an innovating team of Javascript experts, passionate about turning your ideas into robust products.
135+
136+
[Lemoncode](http://lemoncode.net/services/en/#en-home) provides training services.
137+
138+
[Basefactor, consultancy by Lemoncode](http://www.basefactor.com) provides consultancy and coaching services.
139+
140+
For the LATAM/Spanish audience we are running an Online Front End Master degree, more info: http://lemoncode.net/master-frontend

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
"react image focal point"
4747
],
4848
"peerDependencies": {
49-
"react": ">=16.8.0"
49+
"react": ">=16.8.0",
50+
"react-dom": ">=16.8.0"
5051
},
5152
"devDependencies": {
5253
"@lemoncode/config": "*",

0 commit comments

Comments
 (0)