Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

react-scroll-top

nmrvtz61ISC1.0.4

Smoothly scrolls page to it's top

scroll, scrollTop, scrollUp, react, react-component

readme

react-scroll-top

npmversion

This React component provides a simple customisable button that scrolls page to it's top

Install

npm install react-scroll-top

Usage

<ToTop hideAt={160} position="top" />

Parameters

hideAt:number in px

When to hide the button

position:string

Where to show the button

Might be: top, bottom

default: top

style:object (optional)

default:

{
  backgroundColor: 'rgba(255,255,255,0.35)',
  borderRadius: '50%',
  cursor: 'pointer'
}