1.2.0 • Published 3 years ago

@xico2k/react-scroll-area v1.2.0

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

Build Status npm downloads

react-scroll-area Demo

NPM

A scroll area wrapper to mimic Facebook Scroll Area

Demo

Installation

With npm:

$ npm i @xico2k/react-scroll-area

or with yarn:

$ yarn add @xico2k/react-scroll-area

Usage

On your component add:

import ScrollArea from '@xico2k/react-scroll-area';

To render:

<ScrollArea>
    Some Content
</ScrollArea>

Props

All props are optional.

NameTypeDefaultDescription
widthstring / numberEx: 100% / 100px / 100
heightstring / numberEx: 100% / 100px / 100
trackHiddenboolfalse
trackHideTimeint1000Milliseconds
minHandlerHeightint70Pixels
trackMarginint4Pixels
onScrollfunccallback with { scrollTop: 50, innerHeight: 100, outerHeight: 50, complete: 0.5 }
classNamestringclass added to the outer container
innerClassNamestringclass added to the inner container
overflowClassNamestringclass added to the overflow container
trackClassNamestringclass added to the track container
handlerClassNamestringclass added to the handler container

Methods

  • goToBottom(duration = 400);
  • goToTop(duration = 400);
  • goToPos(pos = 50, duration = 400);
  • triggerScroll();
1.2.0

3 years ago

1.1.20

4 years ago

1.1.19

4 years ago

1.1.18

4 years ago

1.1.17

4 years ago

1.1.16

4 years ago

1.1.15

4 years ago

1.1.13

4 years ago

1.1.12

4 years ago

1.1.11

4 years ago

1.1.10

5 years ago

1.1.9

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago