2.0.7-beta • Published 4 years ago

react-page-scroller-qua v2.0.7-beta

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

React Page Scroller (Beta)

Simple React component for smoothy full-page scolling.

New beta version 2.0.6-beta released!!!

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

Example is in demo/src.

Properties

PropertyTypeDescriptionDefault Value
animationTimernumberAnimation duration in milliseconds1000
blockScrollUpboolblock scroll upfalse
blockScrollDownboolblock scroll upfalse
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
handleScrollUnavailablefunctioncallback, is calling when someone tries to scroll over last or first child component
pageOnChangefunctioncallback after page was scrolled
renderAllPagesOnFirstRenderboolflag for render all pages at first render of component
transitionTimingFunctionStringCSS transition timing function nameease-in-out
animationTimerBuffernumberAnimation buffer timing200

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