1.2.1 • Published 5 years ago

react-flick-list v1.2.1

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

react-flick-list

react bindings for kinetic scrolling

This library implements native like scrolling inertia / momentum entirely in JavaScript. It's useful if you have an absolutely positioned element and need to animate/transform it in a way that feels natural. I couldn't have done it without this article

Install

$ npm install react-flick-list --save

Usage

import FlickList from 'react-flick-list'

..

render () {
  return (
    <FlickList>
      {({ position }) => (
        <List componentStyle={{transform: `translateY(-${position}px)`}}/>
      )}
    </FlickList>
  )
}

preview

API

ParamTypefunctionalityrequired
directionString ('y', 'x')tell the library to calculate sizes based on height or width of elementfalse
maxNumbermaxiumum amount to allow library to scrollfalse
minNumberminimum amount to allow library to scrollfalse
allowScrollBooleanuseful for programmatically disallowing scrollingfalse
classNameStringadd custom class to wrapper elementfalse
getRefFunctionAdd a reference to the list elementfalse
ignoreLimitsBooleanIgnore min/max limitations when set to true (default is false)false
getRefFunctionAdd a reference to the list elementfalse
onStartFunctionMethod called when scroll is startedfalse
onScrollingFunctionMethod is called while element is scrollingfalse
onStopFunctionMethod is called when scroll has stoppedfalse
styleObjectadd custom style object to the div elementfalse

License

MIT © Jack Hanford

1.2.1

5 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

7 years ago

0.6.2

7 years ago

0.6.1

7 years ago

0.6.0

7 years ago

0.5.0

7 years ago

0.4.2

7 years ago