Gathering detailed insights and metrics for @opensumi/react-custom-scrollbars-2
Gathering detailed insights and metrics for @opensumi/react-custom-scrollbars-2
Gathering detailed insights and metrics for @opensumi/react-custom-scrollbars-2
Gathering detailed insights and metrics for @opensumi/react-custom-scrollbars-2
npm install @opensumi/react-custom-scrollbars-2
Typescript
Module System
Node Version
NPM Version
72
Supply Chain
93.6
Quality
84.3
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
49,362
Last Day
183
Last Week
1,057
Last Month
3,438
Last Year
49,362
MIT License
309 Commits
1 Branches
5 Contributors
Updated on Aug 20, 2024
Minified
Minified + Gzipped
Latest Version
4.3.4
Package Id
@opensumi/react-custom-scrollbars-2@4.3.4
Unpacked Size
191.71 kB
Size
42.09 kB
File Count
32
NPM Version
10.7.0
Node Version
18.20.3
Published on
Aug 20, 2024
Cumulative downloads
Total Downloads
Last Day
335.7%
183
Compared to previous day
Last Week
4.5%
1,057
Compared to previous week
Last Month
-45.4%
3,438
Compared to previous month
Last Year
0%
49,362
Compared to previous year
3
35
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.