1.0.1 • Published 5 years ago

react-page-scroller-polyfill-fix v1.0.1

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

React Page Scroller

Simple React component for smoothy full-page scolling.

Disclaimer

Please don't use this npm package as I may deleted if the pull request is merged in original repository.

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.

import ReactPageScroller from "react-page-scroller";

goToPage = (pageNumber) => {
  this.reactPageScroller.goToPage(pageNumber);
}

<ReactPageScroller ref={c => this.reactPageScroller = c}>
  (your components here)
</ReactPageScroller>

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

Dependencies

react-page-scroller requires:

  • React
  • lodash
  • Prop Types