Skip to content

trantrivien/react-wheel-fortune

Repository files navigation

react-wheel-fortune

React Wheel Fortune

NPM JavaScript Style Guide

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

before spinning

"Buy Me A Coffee"

License

MIT © besoftvn

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published