# kinetic-react

> Kinetic react scroll list

Latest version **0.4.2** (published 2017-08-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install kinetic-react
pnpm add kinetic-react
yarn add kinetic-react
bun add kinetic-react
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.2 |
| Published | 2017-08-28 |
| First published | 2017-08-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Maintainers | jackhanford |
| Keywords | react, kinetic, scroll, momentum, inertia, flick list |

## Links

- npm: https://www.npmjs.com/package/kinetic-react
- Repository: https://github.com/hanford/kinetic-react
- Issues: https://github.com/hanford/kinetic-react/issues
- npm.io page: https://npm.io/package/kinetic-react

## Dependencies (2)

- [global](https://npm.io/package/global.md) ~4.3.1
- [prop-types](https://npm.io/package/prop-types.md) ~15.5.8

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.4.2 (latest) — 2017-08-28
- 0.4.1 — 2017-08-28
- 0.4.0 — 2017-08-28
- 0.3.0 — 2017-08-28
- 0.2.0 — 2017-08-28
- 0.1.1 — 2017-08-28
- 0.1.0 — 2017-08-27

## README

## 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](https://ariya.io/2013/11/javascript-kinetic-scrolling-part-2)

<br />

## Install

```
$ npm install kinetic-react --save
```

## Usage

```js
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](https://github.com/hanford/kinetic-react/blob/master/example.gif)

## API
| Param          | Type    | functionality | required |
|----------------|---------|-----------------|-----------------|
| direction      | String ('y', 'x') | tell the library to calculate sizes based on height or width of element | false |
| broadcast       | function    | notify HOC of position changes | true |
| max | Number | maxiumum amount to allow library to scroll | false |
| min | Number | minimum amount to allow library to scroll | false |
| element | ref | element to measure / record scrolls on | true |

## TODO:
Publish example

## License

MIT © [Jack Hanford](http://jackhanford.com)

---
_Source: https://npm.io/package/kinetic-react · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
