Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@campusrush/react-page-scroller

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@campusrush/react-page-scroller

Simple React component for smoothy full-page scolling

  • 3.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

FAQs

Package last updated on 04 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc