1.1.0 • Published 5 years ago

react-indiana-drag-scroll-temp-package v1.1.0

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

React Indiana Drag Scroll

Implements scroll on drag

NPM JavaScript Style Guide

Welcome to journey!

npm.io

Try it yourself! Go to demo website.

Install

npm install --save react-indiana-drag-scroll
yarn add react-indiana-drag-scroll

Usage

import React, { Component } from 'react'

import ScrollContainer from 'react-indiana-drag-scroll'

class Example extends Component {
  render () {
    return (
      <ScrollContainer className="scroll-container">
        { ... }
      </ScrollContainer>
    )
  }
}

Component properties

PropTypeDescriptionDefault
verticalBoolAllow vertical drag scrollingtrue
horizontalBoolAllow horizontal drag scrollingtrue
hideScrollbarsBoolHide the scrollbarstrue
activationDistanceNumberThe distance that distinguish click and drag start10
childrenNodeThe content of scrolling container
onScrollFunctionInvoked when user scrolling container
onEndScrollFunctionInvoked when user ends scrolling container
onStartScrollFunctionInvoked when user starts scrolling container
classNameStringThe custom classname for container
styleNumberThe custom styles for container
ignoreElementsStringSelector for elements that should not trigger the scrolling behaviour (for example, ".modal, dialog" or "*prevent-drag-scroll")
nativeMobileScrollBoolUse native mobile drag scroll for mobile devicestrue

License

The source code is licensed under MIT, all images (except hieroglyphs) are copyrighted to their respective owner © Norserium