react-scrollup-lite
TypeScript icon, indicating that this package has built-in type declarations

0.4.0 • Public • Published

react-scrollup-lite

React wrapper component to scroll up/top when user scrolls the page

NPM JavaScript Style Guide

Install

npm install --save react-scrollup-lite

Usage

import React, { Component } from 'react';

import ScrollUp from 'react-scrollup-lite';

class Example extends Component {
    render() {
        return (
            <ScrollUp
                startPosition={0}
                showAtPosition={10}
                position='right'
                className='scroll-up'
                style={{
                    right: '20px',
                }}
            >
                <button>Scroll up</button>
            </ScrollUp>
        );
    }
}

Proptypes

Props Type Description
startPosition number start position to scroll up
showAtPosition number when scrolling the page at what position component children should be visible
position (optional) string left or right (where to show the children component) (default - right)

License

MIT © Madan Kumar

/react-scrollup-lite/

    Package Sidebar

    Install

    npm i react-scrollup-lite

    Weekly Downloads

    9

    Version

    0.4.0

    License

    MIT

    Unpacked Size

    245 kB

    Total Files

    11

    Last publish

    Collaborators

    • jmadankumar