4.5.0 • Published 3 years ago

react-custom-scrollbars-2 v4.5.0

Weekly downloads
186
License
MIT
Repository
github
Last release
3 years ago

react-custom-scrollbars-2

npm npm version npm downloads

Demos · Documentation

Quick note

This 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.

Installation

npm 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.

Usage

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

import { Scrollbars } from 'react-custom-scrollbars-2';

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-2';

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-2/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

vigoworks.components@infinitebrahmanuniverse/nolb-react-cu@everything-registry/sub-chunk-2549dt-librarykedro-vizzzxkite@bjsdistribution/dms-client-return@councilbox/councilbox-ui@draft-js-plugins/emoji@prezly/slate-editor@rocket.js/uikedro-vizzzzkedro-vi122kedro-vizzz123kinetic-uikedro-vizholidoit-jsmy-kviznow-and-wowstartups-website-componentts-ui-lib@avalabs/core-k2-components@avaya/axp-omni-sdk-messaging-ui@bseblu/draft-js-plugins-emoji@brinkninja/components@10play/layout@activecollab/componentsunifyedx-ui@headcore/modelizer-ui@headless-adminapp/app@frontastic/catwalk@grafana/ui@inlightlabs/praise-component@kubevious/ui-browser@kubevious/ui-components@nexray/app@epam/uui-components@mapgear/geoapps-ui-framework@kaspersky/components@pxp-ui/components@pxp-ui/core@quantumblack/kedro-viz@sb1/ffe-searchable-dropdown-react@sb1/ffe-account-selector-react@rio-cloud/rio-uikit@orca-fe/antd-plus@orca-fe/deye-core@shoplflow/base@selfcommunity/react-ui@rocket-js/uimwmakesensemony-shellmystic-soundsbt-storybookrmw-shell-previewsdlb_configuration_visualizerphoqersimplexiar_react_componentssimplyask_componentsgocardless-frontendgift.degpt-code-assistantholidoitlegendary-octo-waddle-emojiimaterial-ui-shell-previewmaxingkeji-common-react@unifiedsoftware/react-ui@up-group-ui/react-controls@zbanx/editable-table@zalastax/nolb-react-cu@stokr/components-libraryairoi-common-uiairoibase-uichuangshi-os-componentchuangshi-os-website-componentcohancreate-tasksdnd-template-editordraft-js-plugins-emojidrag-drop-template-editordt-ui-library
4.5.0

3 years ago

4.4.0

4 years ago

4.3.0

4 years ago

4.2.4

4 years ago

4.2.3

5 years ago

4.2.2

5 years ago

4.2.1

5 years ago