better-scrollbar
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

better-scrollbar

NPM License NPM Version Coverage Status

Highly customizable, high-performance virtual list for big data rendering.

Feel free to provide feedback if there are any issues, and promptly synchronize problem handling.

Installation

npm install better-scrollbar --save

Usage

import React, { Component } from "react"
import ScrollBar from "better-scrollbar"

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

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

import React, { Component } from "react"
import ScrollBar from "better-scrollbar"

class CustomScrollBar extends Component {
  render() {
    return (
      <ScrollBar
        width={this.props.width}
        height={this.props.height}
        onScroll={this.handleScroll}
        onScrollStart={this.handleScrollStart}
        onScrollEnd={this.handleScrollEnd}
        renderView={this.renderView}
        renderTrackHorizontal={this.renderTrackHorizontal}
        renderTrackVertical={this.renderTrackVertical}
        renderThumbHorizontal={this.renderThumbHorizontal}
        renderThumbVertical={this.renderThumbVertical}
        scrollBarHidden
        scrollBarAutoHideTimeout={1000}
        {...this.props}
      />
    )
  }
}

Examples

Run the simple example:

# Make sure that you've installed the dependencies
npm install
npm run site:dev

License

MIT

Package Sidebar

Install

npm i better-scrollbar

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

421 kB

Total Files

83

Last publish

Collaborators

  • kampiu