4.2.1 • Published 8 years ago

react-custom-scrollbars v4.2.1

Weekly downloads
155,676
License
MIT
Repository
github
Last release
8 years ago

react-custom-scrollbars

npm npm version npm downloads

Demos · Documentation

Installation

npm install react-custom-scrollbars --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 are only available on npm.

Usage

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

import { Scrollbars } from 'react-custom-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 'react-custom-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

Examples

Run the simple example:

# Make sure that you've installed the dependencies
npm install
# Move to example directory
cd react-custom-scrollbars/examples/simple
npm install
npm start

Tests

# Make sure that you've installed the dependencies
npm install
# Run tests
npm test

Code Coverage

# Run code coverage. Results can be found in `./coverage`
npm run test:cov

License

MIT

@titaui/pcreact-tpljaivanajaivana_dashboardtarnet-jumbo-reactk2.n3oslt-release@plarin/vendorcf-storybookrdwr-atomic-componentsseamlessdocs-clientcommon-ui-controlsasergis-uibentojs-app-componentspractice-design-systemcpdm-ui-components-v2meitner-componentstoca-chatoneview-guiexp-annotation-toolexp-canvasredpen-canvas@caoyongmeng/ui-1bigendianuistaffpad-ui-libraryweb-pdm-testweb-pdm-test1@nvest-dev/broker-admin-dashboardsplot-plan-editordisprzcomponentstechsee-app-templatemattermost-webapp-lib@mkunak/crm-componentsfertoing-uikit-reactluna-formstegaki-image-editortegaki-key-valuehypernets-experimentreact-web-gifted-scroll-chat@leizciw/creditmint-ui@leizciw/test-guacamole-uireact-design-editor-test-rishnaxviewanpelamobx-antd-admin2ooxx_uidemomediastoresdk-test-libraryrs-tax-testhzero-boothzero-boot-purehzero-front-runtimegtm-cli@cpdmc/display@toplion/webreact-design-editor-andres-mestrasid-npm-test3sid-npmtest-1sid-npmtest-2sid-test-create-npm@echidna/ui@frontastic/componentsmock-officerongcaptial-uicognitiv-ui@chintai/chintai-uilib@chintai/ui-corepeer-genius-clientdesign_editor_pocvibo-ui@clockbook-app/timetracker-module-browsertaskbox-cicifl-layout@infinitebrahmanuniverse/nolb-react-curect-components-007@everything-registry/sub-chunk-2549react-components-007@solussaude/core@solussaude/reactjs-ui-corecaseark-uisnbc-paas-bootcpaas-bootquizzlistmodulequizzmoduletampjstcfw-showcase-edittarnet-uisysu-xgui-for-reacttemporedelectustenon-apptest-meitner-bugwix-rich-content-plugin-giphywix-rich-content-plugin-emojiwix-rich-content-plugin-mapwms_uikit_reactweb-sdk-imweb-pdm-corewebbook-airwayswfacewetrialwex-admin
4.2.1

8 years ago

4.2.0

8 years ago

4.1.2

8 years ago

4.1.1

8 years ago

4.1.0

8 years ago

4.0.2

8 years ago

4.0.1

8 years ago

4.0.0

9 years ago

4.0.0-beta.2

9 years ago

4.0.0-beta.1

9 years ago

3.1.0

9 years ago

3.0.1

9 years ago

3.0.0

9 years ago

3.0.0-beta

9 years ago

2.3.0

9 years ago

2.2.2

9 years ago

2.2.1

9 years ago

2.2.0

9 years ago

2.1.2

9 years ago

2.1.1

9 years ago

2.1.0

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

2.0.0-beta

9 years ago

1.1.0

9 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago

1.0.0-rc2

10 years ago

1.0.0-rc1

10 years ago

0.1.9

10 years ago

0.1.8

10 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago