Gathering detailed insights and metrics for truv-react-custom-scrollbars-2
Gathering detailed insights and metrics for truv-react-custom-scrollbars-2
Gathering detailed insights and metrics for truv-react-custom-scrollbars-2
Gathering detailed insights and metrics for truv-react-custom-scrollbars-2
npm install truv-react-custom-scrollbars-2
Typescript
Module System
Node Version
NPM Version
69.7
Supply Chain
93.3
Quality
73.8
Maintenance
100
Vulnerability
100
License
Total Downloads
4,510
Last Day
7
Last Week
13
Last Month
81
Last Year
966
Minified
Minified + Gzipped
Latest Version
4.3.1-beta.3
Package Id
truv-react-custom-scrollbars-2@4.3.1-beta.3
Unpacked Size
184.78 kB
Size
40.92 kB
File Count
32
NPM Version
8.5.5
Node Version
16.15.0
Cumulative downloads
Total Downloads
3
34
requestAnimationFrame
for 60fpsThis repo is due to the original (fantastic) react-custom-scrollbars
package going a little stale and we needed a handful of bug fixes which will be managed here.
1npm install 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 '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 '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.
Last Day
0%
7
Compared to previous day
Last Week
-7.1%
13
Compared to previous week
Last Month
125%
81
Compared to previous month
Last Year
-36.2%
966
Compared to previous year