Gathering detailed insights and metrics for @duc1607/react-custom-scrollbars-2
Gathering detailed insights and metrics for @duc1607/react-custom-scrollbars-2
Gathering detailed insights and metrics for @duc1607/react-custom-scrollbars-2
Gathering detailed insights and metrics for @duc1607/react-custom-scrollbars-2
npm install @duc1607/react-custom-scrollbars-2
Typescript
Module System
Node Version
NPM Version
69.9
Supply Chain
93.6
Quality
73.6
Maintenance
100
Vulnerability
100
License
Total Downloads
1,710
Last Day
5
Last Week
22
Last Month
66
Last Year
611
Minified
Minified + Gzipped
Latest Version
4.3.0
Package Id
@duc1607/react-custom-scrollbars-2@4.3.0
Unpacked Size
191.27 kB
Size
41.92 kB
File Count
32
NPM Version
6.14.17
Node Version
14.21.0
Cumulative downloads
Total Downloads
Last Day
25%
5
Compared to previous day
Last Week
46.7%
22
Compared to previous week
Last Month
-25.8%
66
Compared to previous month
Last Year
-19.7%
611
Compared to previous year
3
34
requestAnimationFrame
for 60fpsThis repo is forked from react-custom-scrollbars-2
with PR 32
1npm install @duc1607/react-custom-scrollbars-2 --save
This assumes that you’re using npm package manager with a module bundler like Webpack or Browserify to consume CommonJS modules.
If you don’t yet use npm or a modern module bundler, and would rather prefer a single-file UMD build that makes ReactCustomScrollbars
available as a global object, you can grab a pre-built version from unpkg. We don’t recommend this approach for any serious application, as most of the libraries complementary to react-custom-scrollbars-2
are only available on npm.
This is the minimal configuration. Check out the Documentation for advanced usage.
1import { Scrollbars } from '@duc1607/react-custom-scrollbars-2'; 2 3class App extends Component { 4 render() { 5 return ( 6 <Scrollbars style={{ width: 500, height: 300 }}> 7 <p>Some great content...</p> 8 </Scrollbars> 9 ); 10 } 11}
The <Scrollbars>
component is completely customizable. Check out the following code:
1import { Scrollbars } from '@duc1607/react-custom-scrollbars-2'; 2 3class CustomScrollbars extends Component { 4 render() { 5 return ( 6 <Scrollbars 7 onScroll={this.handleScroll} 8 onScrollFrame={this.handleScrollFrame} 9 onScrollStart={this.handleScrollStart} 10 onScrollStop={this.handleScrollStop} 11 onUpdate={this.handleUpdate} 12 renderView={this.renderView} 13 renderTrackHorizontal={this.renderTrackHorizontal} 14 renderTrackVertical={this.renderTrackVertical} 15 renderThumbHorizontal={this.renderThumbHorizontal} 16 renderThumbVertical={this.renderThumbVertical} 17 autoHide 18 autoHideTimeout={1000} 19 autoHideDuration={200} 20 autoHeight 21 autoHeightMin={0} 22 autoHeightMax={200} 23 thumbMinSize={30} 24 universal={true} 25 {...this.props}> 26 ); 27 } 28}
All properties are documented in the API docs
Run the simple example:
1# Make sure that you've installed the dependencies 2npm install 3# Move to example directory 4cd react-custom-scrollbars-2/examples/simple 5npm install 6npm start
1# Make sure that you've installed the dependencies 2npm install 3# Run tests 4npm test
1# Run code coverage. Results can be found in `./coverage` 2npm run test:cov
MIT
No vulnerabilities found.
No security vulnerabilities found.