Skip to content

Commit be6f7c2

Browse files
committed
Update README.md
1 parent 8b2c2ef commit be6f7c2

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

README.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
# React Is In Viewport
22

3-
[![version](https://badge.fury.io/js/react-is-in-viewport.svg)](https://badge.fury.io/js/react-is-in-viewport) [![codecov](https://codecov.io/gh/davidnguyen179/react-is-in-viewport/branch/master/graph/badge.svg)](https://codecov.io/gh/davidnguyen179/react-is-in-viewport) [![Build Status](https://travis-ci.com/davidnguyen179/react-is-in-viewport.svg?branch=master)](https://travis-ci.com/davidnguyen179/react-is-in-viewport) [![Greenkeeper badge](https://badges.greenkeeper.io/davidnguyen179/react-is-in-viewport.svg)](https://greenkeeper.io/) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/davidnguyen179/react-is-in-viewport/blob/master/LICENSE) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
3+
<p align="center">
4+
<img width="500" alt="fit-overlap" src="https://user-images.githubusercontent.com/6290720/71453121-fa0a1d80-27cc-11ea-9e5f-06a4257fe85e.png" />
5+
<br />
6+
<br />
7+
</p>
8+
9+
The component allows to track the other React components whether or not it is in the Viewport.
410

511
<hr />
612

7-
The component allows to track the other React components whether or not it is in the Viewport.
13+
[![version](https://badge.fury.io/js/react-is-in-viewport.svg)](https://badge.fury.io/js/react-is-in-viewport) [![codecov](https://codecov.io/gh/davidnguyen179/react-is-in-viewport/branch/master/graph/badge.svg)](https://codecov.io/gh/davidnguyen179/react-is-in-viewport) [![Build Status](https://travis-ci.com/davidnguyen179/react-is-in-viewport.svg?branch=master)](https://travis-ci.com/davidnguyen179/react-is-in-viewport) [![Greenkeeper badge](https://badges.greenkeeper.io/davidnguyen179/react-is-in-viewport.svg)](https://greenkeeper.io/) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/davidnguyen179/react-is-in-viewport/blob/master/LICENSE) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![quality](https://npm.packagequality.com/shield/react-is-in-viewport.svg)](https://packagequality.com/#?package=react-is-in-viewport)
14+
15+
[![Package Quality](https://npm.packagequality.com/badge/react-is-in-viewport.png)](https://packagequality.com/#?package=react-is-in-viewport)
816

917
## Installation
1018

@@ -33,18 +41,17 @@ Here is how `type = 'fit'` and `type = 'overlap'` look like:
3341

3442
**fit**
3543

36-
<img width="150" alt="Screen Shot 2019-12-22 at 17 10 58" src="https://user-images.githubusercontent.com/6290720/71319400-46a9dc00-24e1-11ea-81ee-85e1bd40ca08.png">
44+
<img width="150" alt="fit" src="https://user-images.githubusercontent.com/6290720/71453430-86691000-27ce-11ea-94c7-828e90df09b7.png" />
3745

3846
**overlap**
3947

40-
<img width="150" alt="Screen Shot 2019-12-22 at 17 11 05" src="https://user-images.githubusercontent.com/6290720/71319410-66d99b00-24e1-11ea-9fe9-96fc68d11aa2.png">
41-
48+
<img width="150" alt="overlap" src="https://user-images.githubusercontent.com/6290720/71453432-86691000-27ce-11ea-8d28-6130d381a8e1.png">
4249

4350
## API
4451

4552
| Name| Type | Parameter | Description
4653
|--|--|--|--|
47-
| onLoad | void | | When component first appears in the viewport |
54+
| onLoad | void | | When components first appear and fit in the viewport |
4855
| onEnter | void | enterCount | When scrolling to a component, the `enterCount` increase 1 |
4956
| onLeave | void | leaveCount | When scrolling away from a component, the `leaveCount` increase 1 |
5057
| onFocusOut | void | focusCount | When component is not in the viewport, then `onFocusOut` called with seconds user spent on the component |
@@ -171,3 +178,7 @@ class App extends React.Component {
171178

172179
ReactDOM.render(<App />, document.getElementById('root'));
173180
```
181+
182+
# License
183+
184+
This project is licensed under the MIT License - see the [LICENSE](https://github.com/davidnguyen179/react-is-in-viewport/blob/master/LICENSE) file for details

0 commit comments

Comments
 (0)