A react component that renders a scroll-to-top button.
npm install react-scroll2top-button
In your .jsx
import React, { Component } from 'react'; import Scroll2TopButton from 'react-scroll2top-button'; export default class App extends Component { 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>); } }
| Property | Description | Type | Required |
|---|---|---|---|
| delay | scrolling with [delay]ms delay | number | NO |
| scrollStep | scrolling per [scrollStep] pixels | number | NO |
| color | button color | string | NO |
npm install
npm start
Open http://localhost:5000
ESLint with React linting options have been enabled.
npm run lint
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.