Git Product home page Git Product logo

react-scroll2top-button's Introduction

React Scroll2TopButton component

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

Demo

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

Property Description Type Required
delay scrolling with [delay]ms delay number NO
scrollStep scrolling per [scrollStep] pixels number NO
color button color string NO

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.

react-scroll2top-button's People

Contributors

b3llash avatar teobais avatar

Watchers

 avatar

react-scroll2top-button's Issues

Stuff not working?

So, following https://stackoverflow.com/a/46512165/4522960:

I'm now a bit confused with what's the issue is.

Originally I though it was the fact that you're not able to consume the module from an external package, but not it seems like you're attempting to import it from the same package?

See fork that attempt to demonstrate a flow in which the package is independently built following an install.
This is only the general idea, ignoring module-system issues and package duplicates.
Is this what you were aiming for?

Also, see https://medium.com/@BrodaNoel/how-to-create-a-react-component-and-publish-it-in-npm-668ad7d363ce

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.