3.0.4 • Published 5 years ago

@opuscapita/react-perfect-scrollbar v3.0.4

Weekly downloads
2,181
License
MIT
Repository
github
Last release
5 years ago

React Perfect Scrollbar

Description

React wrapper for perfect-scrollbar with OpusCapita styles.

Installation

npm install @opuscapita/react-perfect-scrollbar

Demo

View the DEMO

Builds

UMD

The default build with compiled styles in the .js file. Also minified version available in the lib/umd directory.

CommonJS/ES Module

You need to configure your module loader to use cjs or es fields of the package.json to use these module types. Also you need to configure sass loader, since all the styles are in sass format.

API

Prop nameTypeDefaultDescription
classNamestringExtra class names
optionobjectPerfectScrollbar options
containerReffunctionRef for the container
onScrollYfunctiononScollY callback
onScrollXfunctiononScollX callback
onScrollUpfunctiononScollUp callback
onScrollYDownfunctiononScollDown callback
onScrollLeftfunctiononScollLeft callback
onScrollRightfunctiononScollRight callback
onYReachStartfunctiononYReachStart callback
onYReachEndfunctiononYReachEnd callback
onXReachStartfunctiononXReachStart callback
onXReachEndfunctiononXReachEnd callback

Code example

import React from 'react';
import PerfectScrollbar from '@opuscapita/react-perfect-scrollbar';

export default class ListView extends React.Component {
  render() {
    return (
      <PerfectScrollbar>
        <SomeList />
      </PerfectScrollbar>
    );
  }
}