react-scrollie
v1.0.1
Published
Scroll listener React component that provide scrolling info to children as render prop.
Downloads
7
Readme
Features
- Only 5.73KB (that's 2.53KB gzipped!).
- Detect scroll edges:
startX
,endX
,startY
,endY
. - Built for React 16.
Installation
npm install react-scrollie --save
or
yarn add react-scrollie
Usage
import React from 'react'
import Scrollie from 'react-scrollie'
const Demo = () => (
<Scrollie>
{scroll => (
<ul>
<li>Start X: {scroll.startX}
<li>End X: {scroll.endX}
<li>Start Y: {scroll.startY}
<li>End Y: {scroll.endY}
</ul>
)}
</Scrollie>
)
When <Scrollie />
is mounted it will start to listen to scroll events and will execute the children
render prop providing info about scroll position.
The children
is expected to be a function.
Documentation
| Properties | Type | Default | Description |
| --- | --- | --- | --- |
| component
| String
| div
| The component to be rendered in place of a Scrollie
. |
Tests
TBD
Development
To start contributing to this project, please do:
- Fork and clone this repo.
- Do your work.
- Create a PR.
Releases
To release this project the following tasks should be done:
- Build distribution files:
yarn build
. - Bump version and create tag:
npm version #.#.# -m 'Version %s.'
. - Push new created tag:
git push origin --tags
. - Publish:
npm publish
.
Made with :heart: by Rubens Mariuzzo.