1.0.6 • Published 6 years ago

react-scroll2top-button v1.0.6

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

React Scroll2TopButton component

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

Demo

Usage

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>);
  }
}

Properties

PropertyDescriptionTypeRequired
delayscrolling with delayms 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.