3.0.1 • Published 6 months ago

react-page-scroller v3.0.1

Weekly downloads
2,137
License
MIT
Repository
github
Last release
6 months ago

React Page Scroller

Simple React component for smoothy full-page scolling.

Demo

You can scroll the page using mouse wheel, touch scroll or keyboard arrows.

Live demo: vikliegostaiev.github.io/react-page-scroller

To run demo app locally:

npm install
npm start

App will start on localhost:3000.

Installation

via npm:

npm install react-page-scroller --save

Usage

import ReactPageScroller from 'react-page-scroller';

Example is in demo/src.

Properties

PropertyTypeDescriptionDefault Value
animationTimernumberAnimation duration in milliseconds1000
animationTimerBuffernumberAnimation buffer timing200
blockScrollUpboolblock scroll upfalse
blockScrollDownboolblock scroll downfalse
containerHeightnumber/stringheight of react-page-scroller element100vh
containerWidthnumber/stringwidth of react-page-scroller element100vw
customPageNumbernumberexternal selected page, number of pages should start from 0, should be combined with pageOnChange usage (see example in demo/src/FullPage.js for more information). This prop was introduced as a replacement for "goToPage" method from legacy version
renderAllPagesOnFirstRenderboolflag for render all pages at first render of component
transitionTimingFunctionStringCSS transition timing function nameease-in-out
handleScrollUnavailablefunctioncallback, is calling when someone tries to scroll over last or first child component
onBeforePageScrollfunctioncallback before page scroll occured (passes the index of next page in argument)
pageOnChangefunctioncallback after page was scrolled

SectionContainer component

PropertyTypeDescriptionDefault Value
heightnumberheight in percentage (i.e. 20, 50)100

Dependencies

react-page-scroller requires:

  • React
  • lodash
  • Prop Types

Legacy Properties

PropertyTypeDescriptionDefault Value
animationTimernumberAnimation duration in milliseconds1000
transitionTimingFunctionStringCSS transition timing function nameease-in-out
pageOnChangefunctioncallback on page scroll
goToPagefunctionusing with ref, go to selected page, number of pages must start from 0
scrollUnavailablefunctioncallback, is calling when someone tries to scroll over last or first child component
containerHeightnumber/stringheight of react-page-scroller element100vh
containerWidthnumber/stringwidth of react-page-scroller element100vw
blockScrollUpboolblock scroll upfalse
blockScrollDownboolblock scroll upfalse
3.0.1

6 months ago

2.3.0

2 years ago

2.3.1

2 years ago

2.2.1

3 years ago

2.2.0

3 years ago

2.1.0

3 years ago

2.0.11-beta

3 years ago

2.0.10-beta

4 years ago

2.0.9-beta

4 years ago

2.0.8-beta

4 years ago

2.0.7-beta

4 years ago

2.0.6-beta

4 years ago

2.0.5-beta

4 years ago

2.0.4-beta

4 years ago

2.0.3-beta

4 years ago

2.0.2-beta

4 years ago

2.0.1-beta

4 years ago

2.0.0-beta

4 years ago

1.5.1

5 years ago

1.4.3

5 years ago

1.4.2

6 years ago

1.4.0

6 years ago

1.3.2

6 years ago

1.3.1

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.9

6 years ago

1.1.8

6 years ago

1.1.7

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.0

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.0.4

6 years ago

1.0.3

7 years ago

1.0.2

7 years ago