Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

React scrollbars component

License

NotificationsYou must be signed in to change notification settings

ibitcy/react-custom-scrollbars

 
 

Repository files navigation

npmnpm versionnpm downloads

Demos ·Documentation

Installation

npm install react-custom-scrollbars --save

This assumes that you’re usingnpm package manager with a module bundler likeWebpack orBrowserify to consumeCommonJS modules.

If you don’t yet usenpm or a modern module bundler, and would rather prefer a single-fileUMD build that makesReactCustomScrollbars available as a global object, you can grab a pre-built version fromunpkg. Wedon’t recommend this approach for any serious application, as most of the libraries complementary toreact-custom-scrollbars are only available onnpm.

Usage

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

import{Scrollbars}from'react-custom-scrollbars';classAppextendsComponent{render(){return(<Scrollbarsstyle={{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';classCustomScrollbarsextendsComponent{render(){return(<ScrollbarsonScroll={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}autoHideautoHideTimeout={1000}autoHideDuration={200}autoHeightautoHeightMin={0}autoHeightMax={200}thumbMinSize={30}universal={true}{...this.props}>    );}}

All properties are documented in theAPI docs

Examples

Run the simple example:

# Make sure that you've installed the dependenciesnpm install# Move to example directorycd react-custom-scrollbars/examples/simplenpm installnpm start

Tests

# Make sure that you've installed the dependenciesnpm install# Run testsnpmtest

Code Coverage

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

License

MIT

About

React scrollbars component

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript79.4%
  • TypeScript20.6%

[8]ページ先頭

©2009-2025 Movatter.jp