Git Product home page Git Product logo

react-scrollbars-custom's Introduction

react-scrollbars-custom

DEMO · DOCUMENTATION

  • Native browser scrolling behaviour - component don't emulate scrolling, only showing custom scrollbars
  • Ultimate performance - 60 fps with help of RAF loop
  • Desktop or mobile - scrollbars looks the same on any device
  • No extra stylesheets required - minimum inline styles out of the box
  • Fully customizable - want a hippo as a scrollbar thumb? Well.. I don't judge you
  • No matter what changes the content - scrollbars always stay actual
  • Total tests coverage
  • Scrollbars nesting
  • RTL support (read more)
  • momentum scrolling for iOS

IMPORTANT: default component styles uses Flexible Box Layout for proper scrollbars display.
But you can customize it with help pf inline or linked styles as you wish (see docs).

Installation

npm i --save react-scrollbars-custom

Usage

Minimal configuration

class App extends Component
{
    render() {
        return (
                <Scrollbar style={ {width: '100%', height: '100%', minHeight: 300} } >
                    <p>Hello world!</p>
                </Scrollbar>
        );
    }
}

All properties and methods are in the API Documentation

Examples

Run the example, it will install dependencies, build current component version and run local web-server listening localhost:3000 (browser window will open automatically)

# install dependencies if you haven't yet
npm install
npm run examples

Tests

# install dependencies if you haven't yet
npm install
npm run test

Credits

Big thanks to @malte-wessel with his react-custom-scrollbars which I used before writing this component.
So don't be wondered that repos and code look similar in some places, his package used as ethalon. And for the users convenience i've tried to make API's seamless as much as it possible.

react-scrollbars-custom's People

Contributors

xobotyi avatar teddriggs avatar

Watchers

Dreamer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.