Skip to content

Repository files navigation

React Scroll2TopButton component

A react component that renders a scroll-to-top button.

Demo

Demo

Usage

npm install react-scroll2top-button

In your .jsx

importReact,{Component}from'react';importScroll2TopButtonfrom'react-scroll2top-button';exportdefaultclassAppextendsComponent{render(){return(// Add your component markup and other subcomponent references here.<div><h1>Hello, World!</h1><h1>Hello, World!</h1><h1>Hello, World!</h1>
...
<Scroll2TopButton/></div>);}}

Properties

PropertyDescriptionTypeRequired
delayscrolling with [delay]ms delaynumberNO
scrollStepscrolling per [scrollStep] pixelsnumberNO
colorbutton colorstringNO

Example

npm install
npm start
Open http://localhost:5000

Linting

ESLint with React linting options have been enabled.

npm run lint

Credits

Big thanks to react-es6-webpack-boilerplate, which provided the base of this project and of course gave me the chance to have a very first viewing on the latest front-end configurations.

Releases

Packages

Used by

Contributors

Languages