Skip to content
This repository has been archived by the owner on May 21, 2023. It is now read-only.
/ react-scrl Public archive

πŸ‘“ Simple and versatile stylized scrollbar for React β›” Deprecated

License

Notifications You must be signed in to change notification settings

neki-dev/react-scrl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

react-scrl

  • Simple and versatile stylized scrollbar for React

    • Size 245 byte
    • Vertical and horizontal
    • Stylizing
    • Touchable (soon...)

npm i react-scrl
  • Usage

import React, {useCallback} from 'react';
import Scrollbar from 'react-scrl';

export default () => {

    /**
     * @param {number} x - Left offset in px
     * @param {number} y - Top offset in px
     * @param {Object} offsets - Offsets in %
     * @param {boolean} isDragging - Is scrolling by mouse drag
     */
    const onScroll = useCallback((e) => {
        console.log(e.x, e.y);
    }, []);

    return (
        /**
         * @param {string} className - Custom class for wrapper
         * @param {Object} defaultOffsets - Default offsets in %
         * @param {number} speed - Speed of scrolling
         * @param {function} onScroll - Event of scrolling
         */
        <Scrollbar className="example" speed={1} defaultOffsets={{x: 0, y: 0}} onScroll={onScroll}>
            <p>So many letters...</p>
        </Scrollbar>
    );

};

About

πŸ‘“ Simple and versatile stylized scrollbar for React β›” Deprecated

Topics

Resources

License

Stars

Watchers

Forks