Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/threepointone/react-ease

animations for react
https://github.com/threepointone/react-ease

Last synced: about 1 month ago
JSON representation

animations for react

Lists

README

        

(work in progress, looking for feedback)

react-ease
---

back to first principles

`npm install react-ease react --save`

canned animations for [react](https://facebook.github.io/react/)/[react-native](https://facebook.github.io/react-native/)

(if you're looking for something more dynamic, consider [react-springs](https://github.com/threepointone/react-springs))

```js
// output floats from 0 to 100 over 0.5 seconds

{val =>

{val}
} // yes, children is a function

// you can tell when it's done

{(val, done) =>

animation {done ? 'over!' : 'running...'}
}

// you can ease multiple values at once

{val =>

move it, move it
}

// or if you want more control over each value
{x =>
{y =>

not bad!
}
}

// finally, you can chain a bunch of them together
done && console.log('done!')}
repeat={5}>
{(val, done) =>

sweet!
}

```

Ease::props
---

- from: *number*/*object*
- to: *number*/*object*
- duration: *number* (ms)
- ease: *string*/*function* `./src.js` has a list of available easing functions, or pass in your own
- delay: *number* (ms)
- onProgress: *function* - optional callback called on every 'movement'. 'returns' the current value, and a `done` flag
- repeat: *number*

Chain::props
---

- sequence: *array*
- repeat: *number*

thanks
---
- [ease-sential](https://github.com/WebReflection/ease-sential), of which react-ease contains a tweaked port