react-awesome-scroll

0.1.4 • Public • Published

react-awesome-scroll

npm npm version

  • Custom styled scrollbar with exact native behavior.
  • Easily customisable
  • No external dependencies
  • Has 2 style presets out of the box: You can use it out of box or just with the styles needed for component to scroll content properly. (Or disable all of the styles and add them manually in your project stylesheet system).

Demo

Installation

npm

npm install react-awesome-scroll --save

yarn

yarn add react-awesome-scroll

Usage

Basic

In order to use the component with it out-of-the-box design, you'll need to just call the component in your React app. You will also need to limit the height of its wrapper, so that the component can get its size limits.

import Scroll from 'react-awesome-scroll';
 
class CustomScroll extends Component {
  // Contains demo wrapper
  render() {
    return (
      <div style={{ height: 300 }}>
        <Scroll>
          /* Any content here */
        </Scroll>
      </div>
    );
  }
}
  

Customised

import Scroll from 'react-awesome-scroll';
 
class CustomScroll extends Component {
  // Contains demo wrapper
  render() {
    return (
      <div style={{ height: 300 }}>
        <Scroll
          className="scroll"
          containerClassName="scroll-container"
          innerClassName="scroll-inner"
          scrollClassName="scroll-track"
          barClassName="scroll-bar"
          barActiveClassName="scroll-bar-active"
          disableStyles
          disableUIStyles
        >
          /* Any content here */
        </Scroll>
      </div>
    );
  }
}

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.1.410latest

Version History

VersionDownloads (Last 7 Days)Published
0.1.410
0.1.30
0.1.20
0.1.10
0.1.00
0.0.130
0.0.120
0.0.110
0.0.100
0.0.60
0.0.50
0.0.30
0.0.20

Package Sidebar

Install

npm i react-awesome-scroll

Weekly Downloads

10

Version

0.1.4

License

MIT

Last publish

Collaborators

  • banana.bobby