It is a simple vertical scroll library.
yarn add -D simple-v-scrollbar
Then use it in your app:
import React from 'react';
import SimpleVScrollbar from 'simple-v-scrollbar';
class App extends React.Component {
render() {
return (
<SimpleVScrollbar width={500} height={300}>
<div>contents1</div>
<div>contents2</div>
<div>contents3</div>
<div>contents4</div>
<div>contents5</div>
</SimpleVScrollbar>
);
}
}
Note: If width / height is not specified, 100% is specified.
className
- give the class name (string)width
- width. If not specified, 100% (number)height
- height. If not specified, 100% (number)top
- scroll position (number)scrollTop
- event to be executed after changing the scroll position (function)scrollEnd
- event to be executed when the scroll reaches the bottom (function)autoHide
- automatic hiding of scroll bars (boolean)autoHideTimeout
- hide time (number)
MIT