1.0.6 • Published 2 years ago
react-wheel-fortune v1.0.6
react-wheel-fortune
React Wheel Fortune
Install
npm install --save react-wheel-fortunenpm install --save react-wheel-fortune --legacy-peer-depsyarn add react-wheel-fortune| Properties | default value | Optional |
|---|---|---|
| items | NA | No |
| size | 200 | Yes |
| fontSize | 10 | Yes |
| spacing | 50 | Yes |
| color | '#da3768' | Yes |
| wheelTurn | 5 | Yes |
| duration | 5 | Yes |
| timeReset | 0.25 | Yes |
| borderSize | 5 | Yes |
| result | RANDOM | Yes |
| disable | false | Yes |
| onFinished | N/A | Yes |
| onStart | N/A | Yes |
Usage
import React from 'react'
import { BasicWheel } from 'react-wheel-fortune'
import 'react-wheel-fortune/dist/index.css'
const App = () => {
let items: any[] = [
<p>BESOFT
<img
height={20}
src='***.png' />
</p>,
"WIN1",
"LOST",
"HELLO"]
let wheelColor: string = "#000"
return <BasicWheel
items={items}
color={wheelColor}
result={3} // index of value in array (if not set it random result)
textColor='#fff'
/>
}
export default AppDEMO

License
MIT © besoftvn
