1.0.9 • Published 3 years ago

react-scrl v1.0.9

Weekly downloads
124
License
MIT
Repository
github
Last release
3 years ago

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

};
1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago