0.4.2 • Published 7 years ago

kinetic-react v0.4.2

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

kinetic-react

react bindings for kinetic scrolling

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

Install

$ npm install kinetic-react --save

Usage

import Kinetic from 'kinetic-react'

..

transformElement = ({ position }) => {
  this.setState({ position })
}

render () {
  const { position } = this.state

  return (
    <div style={{ transform: `translateY(${position}px)` }}>
      {this.list && <Kinetic element={this.list} broadcast={this.transformElement}/>}

      <List ref={c => this.list = c} {...props} />
    </div>
  )
}

preview

API

ParamTypefunctionalityrequired
directionString ('y', 'x')tell the library to calculate sizes based on height or width of elementfalse
broadcastfunctionnotify HOC of position changestrue
maxNumbermaxiumum amount to allow library to scrollfalse
minNumberminimum amount to allow library to scrollfalse
elementrefelement to measure / record scrolls ontrue

TODO:

Publish example

License

MIT © Jack Hanford

0.4.2

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago