react-wheel-fortune
v1.0.6
Published
Made with create-react-library
Downloads
15
Maintainers
Readme
react-wheel-fortune
React Wheel Fortune
Install
npm install --save react-wheel-fortune
npm install --save react-wheel-fortune --legacy-peer-deps
yarn 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 App
DEMO
License
MIT © besoftvn