1.0.2 • Published 5 years ago

react-sam-scrollbar v1.0.2

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

react-sam-scrollbar

Handle element scroll like Mobile phone scrollViewBar

Demo

avatar

git clone https://github.com/Sammiu/react-sam-scrollbar.git
cd react-sam-scrollbar
npm i && npm run examples

Installation

npm i react-sam-scrollbar
// OR
yarn add react-sam-scrollbar

Examples

1. Render prop pattern

import ScrollBar from 'react-sam-scrollbar'

     <div>
       <ScrollBar disableHorizontal={true}>
           <ul className="select-dropdown_list">
              {data && data.map(item => (
                 <li key={item.id}><span className="select-dropdown_item_text">{item.name}</span></li>))}
                    </ul>
        </ScrollBar>
      </div>

API

PropTypeDescriptionDefault
onScrollfunctionCallback event when scrolling-----
noResizeBoolIf the container size does not change, it is best to set it to optimize performancetrue
maxHeightnumberthe maximum height of the rolling container250px
disableVerticalBoolDisable vertical scroll barfalse
disableHorizontalBoolDisable horizontal scroll barfalse