Volver al ranking

malte-wessel/react-custom-scrollbars

JavaScriptmalte-wessel.github.io/react-custom-scrollbars/

React scrollbars component

scrollingreactscrollbarscustomizable
Crecimiento de estrellas
Estrellas
3.2k
Forks
563
Crecimiento semanal
Issues
160
1k2k3k
ene 2023mar 2024may 2025jul 2026
Artefactosnpmnpm install react-custom-scrollbars
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 }}>
        <p>Some great content...</p>
      </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

Repositorios relacionados
alvarotrigo/fullPage.js

fullPage plugin by Alvaro Trigo. Create full screen pages fast and simple

JavaScriptnpmGNU General Public License v3.0javascriptscrolling
alvarotrigo.com/fullPage/
35.4k7.1k
noah-nuebling/mac-mouse-fix

Mac Mouse Fix - Make Your $10 Mouse Better Than an Apple Trackpad!

Objective-COthermousemouse-events
macmousefix.com
10.5k373
TanStack/virtual

🤖 Headless UI for Virtualizing Large Element Lists in JS/TS, React, Solid, Vue and Svelte

TypeScriptnpmMIT Licensereactreactjs
tanstack.com/virtual
7k451
linearmouse/linearmouse

The mouse and trackpad utility for Mac.

SwiftMIT Licensemacmacos
linearmouse.app
6.5k141
thebuilder/react-intersection-observer

React implementation of the Intersection Observer API to tell you when an element enters or leaves the viewport.

TypeScriptnpmMIT Licenseintersectionobserver-apireact
react-intersection-observer.vercel.app
5.5k189
alvarotrigo/pagePiling.js

pagePiling plugin by Alvaro Trigo. Create a scrolling pile of sections. http://alvarotrigo.com/pagePiling/

JavaScriptnpmjavascriptscrolling
4.1k635
telly/TLYShyNavBar

Unlike all those arrogant UINavigationBar, this one is shy and humble! Easily create auto-scrolling navigation bars!

Objective-CMIT Licenseuinavigationcontrollernavigation
3.7k419
inokawa/virtua

A zero-config, fast and small (~3kB) virtual list (and grid) component for React, Vue, Solid and Svelte.

TypeScriptnpmMIT Licenseinfinite-scrollperformance
inokawa.github.io/virtua/
3.6k110
AlloyTeam/PhyTouch

Smooth scrolling, rotation, pull to refresh, page transition and any motion for the web - 丝般顺滑的触摸运动方案

JavaScriptnpmMIT Licensetouchscrolling
alloyteam.github.io/PhyTouch/
3k515
hsnaydd/moveTo

A lightweight scroll animation javascript library without any dependency

JavaScriptnpmMIT Licensemovetoscrolling
hsnaydd.github.io/moveTo/demo/
2.9k94
albinotonnina/albinotonnina.com

Personal portfolio website with interactive animations and visual storytelling. Built with React, featuring modular scene management, comprehensive testing, and smooth cross-device performance.

JavaScriptnpmOtherportfolio-websitescrolling
albinotonnina.com
2.8k498
wilddeer/stickyfill

Polyfill for CSS `position: sticky`

HTMLMIT Licensepolyfillsticky-elements
2.3k247