0.0.14 • Published 6 years ago

react-back-to-top-button v0.0.14

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

React-back-to-top-button

A React component that scrolls back to the top.

Installation

With npm:

npm install react-back-to-top-button

With yarn:

yarn add react-back-to-top-button

Example

import React, { Component } from "react";
import BackToTop from "react-back-to-top";

class App extends Component {
  render() {
    return (
      <BackToTop
        showOnScrollUp
        showAt={100}
        speed={1500}
        easing="easeInOutQuint"
      >
        <span>scroll up</span>
      </BackToTop>
    );
  }
}

Props

PropRequiredDefaultTypeDescription
children"UP"React.ReactElement / stringcontent of the back to top component
scrollTo0numberscroll to a certain position on click
showOnScrollUpfalsebooleanshow the back to top button only when the user scrolls up.
showAt1000numbershow the button at y position
speed2000numberscrolling speed
easing"easeOutSine"stringscroll timing function. Options: "easeOutSine", "easeInOutSine", "easeInOutQuint"
styleObjectstyle of the floating button.

License

MIT

0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago