A slot machine library for React
npm install react-slot-machineA slot machine library for React
!DEMO
``bash`
npm i --save react-slot-machineor
yarn add react-slot-machine
`jsx
import React from 'react';
import Slot from 'react-slot-machine';
import list from './my-list';
const YourComponent = props => (
be sure to be width and height are 100%.
}
$3
| Name | Type | Required | Description |
| --------- | -------- | -------- | --------------------------------- |
| target | Number | [x] | Index to target item |
| duration | Number | [ ] | Duration of scrolling |
| easing | Function | [ ] | Easing function (see below) |
| times | Number | [ ] | Times to spin |
| onEnd | Function | [ ] | Event fires on ended of scrolling |
| className | String | [ ] | className |
#### Easing Function
Function receive
(elapsed, initialValue, amountOfChange, duration)` and return value to change.It is compatible with bameyrick/js-easing-functions.
Written by MIT LICENSE