MCPcopy
hub / github.com/malte-wessel/react-custom-scrollbars

github.com/malte-wessel/react-custom-scrollbars @v4.2.1 sqlite

repository ↗ · DeepWiki ↗ · release v4.2.1 ↗
105 symbols 249 edges 39 files 0 documented · 0%
README

react-custom-scrollbars

npm npm version npm downloads

  • frictionless native browser scrolling
  • native scrollbars for mobile devices
  • fully customizable
  • auto hide
  • auto height
  • universal (runs on client & server)
  • requestAnimationFrame for 60fps
  • no extra stylesheets
  • well tested, 100% code coverage

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 }}>


Some great content...


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

Core symbols most depended-on inside this repo

scrollTop
called by 14
src/Scrollbars/index.js
scrollLeft
called by 10
src/Scrollbars/index.js
getScrollbarWidth
called by 6
src/utils/getScrollbarWidth.js
hideTracks
called by 6
src/Scrollbars/index.js
getScrollLeft
called by 5
src/Scrollbars/index.js
getScrollTop
called by 5
src/Scrollbars/index.js
getThumbHorizontalWidth
called by 4
src/Scrollbars/index.js
getThumbVerticalHeight
called by 4
src/Scrollbars/index.js

Shape

Method 74
Class 20
Function 11

Languages

TypeScript100%

Modules by API surface

src/Scrollbars/index.js53 symbols
examples/simple/components/SpringScrollbars/SpringScrollbars.js11 symbols
examples/simple/components/ColoredScrollbars/ColoredScrollbars.js6 symbols
src/Scrollbars/defaultRenderElements.js5 symbols
examples/simple/components/SpringScrollbars/App.js5 symbols
examples/simple/components/ShadowScrollbars/ShadowScrollbars.js5 symbols
test/Scrollbars/universal.js3 symbols
examples/simple/components/ShadowScrollbars/App.js3 symbols
examples/simple/components/DefaultScrollbars/App.js3 symbols
examples/simple/components/ColoredScrollbars/App.js3 symbols
test/Scrollbars/index.js1 symbols
test/Scrollbars/flexbox.js1 symbols

Dependencies from manifests, versioned

autoprefixer-loader3.1.0 · 1×
babel-cli6.2.0 · 1×
babel-core6.2.1 · 1×
babel-eslint6.1.2 · 1×
babel-loader6.2.0 · 1×
babel-preset-es20156.1.18 · 1×
babel-preset-react6.3.13 · 1×
babel-preset-stage-16.1.18 · 1×
babel-register6.3.13 · 1×
babel-runtime6.3.19 · 1×
bootstrap-sass3.3.6 · 1×
cross-env3.1.3 · 1×

For agents

$ claude mcp add react-custom-scrollbars \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact