rc-scrollbars

React scrollbars component

rc-scrollbars downloads rc-scrollbars version rc-scrollbars license

rc-scrollbarsSimilar Packages:

Npm Package Weekly Downloads Trend

3 Years
🌟 Show real-time usage chart on rc-scrollbars's README.md, just copy the code below.
## Usage Trend
[![Usage Trend of rc-scrollbars](https://npm-compare.com/img/npm-trend/THREE_YEARS/rc-scrollbars.png)](https://npm-compare.com/rc-scrollbars#timeRange=THREE_YEARS)

Cumulative GitHub Star Trend

🌟 Show GitHub stars trend chart on rc-scrollbars's README.md, just copy the code below.
## GitHub Stars Trend
[![GitHub Stars Trend of rc-scrollbars](https://npm-compare.com/img/github-trend/rc-scrollbars.png)](https://npm-compare.com/rc-scrollbars)

Stat Detail

Package
Downloads
Stars
Size
Issues
Publish
License
rc-scrollbars24,262159363 kB173 years agoMIT

README for rc-scrollbars

rc-scrollbars

rejuvenated project of react-custom-scrollbars

npm npm version npm downloads

  • frictionless native browser scrolling
  • native scrollbars for mobile devices
  • fully customizable
  • auto hide
  • auto height
  • universal (runs on client & server)
  • requestAnimationFrame for 60fps
  • no extra stylesheets
  • well tested, 100% code coverage

Documentation · Demos

Installation

npm install rc-scrollbars --save

# OR

yarn add rc-scrollbars

This assumes that you’re using npm package manager with a module bundler like Webpack or Browserify to consume CommonJS modules.

Usage

This is the minimal configuration. Check out the Documentation for advanced usage.

import { Scrollbars } from 'rc-scrollbars';

class App extends Component {
  render() {
    return (
      <Scrollbars style={{ width: 500, height: 300 }}>
        <p>Some great content...</p>
      </Scrollbars>
    );
  }
}

The <Scrollbars> component is completely customizable. Check out the following code:

import { Scrollbars } from 'rc-scrollbars';

class CustomScrollbars extends Component {
  render() {
    return (
      <Scrollbars
        onScroll={this.handleScroll}
        onScrollFrame={this.handleScrollFrame}
        onScrollStart={this.handleScrollStart}
        onScrollStop={this.handleScrollStop}
        onUpdate={this.handleUpdate}
        renderView={this.renderView}
        renderTrackHorizontal={this.renderTrackHorizontal}
        renderTrackVertical={this.renderTrackVertical}
        renderThumbHorizontal={this.renderThumbHorizontal}
        renderThumbVertical={this.renderThumbVertical}
        autoHide
        autoHideTimeout={1000}
        autoHideDuration={200}
        autoHeight
        autoHeightMin={0}
        autoHeightMax={200}
        thumbMinSize={30}
        universal={true}
        {...this.props} />
    );
  }
}

All properties are documented in the API docs

Run project locally

Run the simple example:

# Make sure that you've installed the dependencies
yarn
# Run tsc of Scrollbars in watch mode and the documentation project in dev env
yarn dev

License

MIT