0.1.14 • Published 12 months ago

react-roulette-board v0.1.14

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

react-roulette-board

react-roulette-board

Installation

npm

npm install react-roulette-board

Example

import React from "react";
import { RouletteBoard } from "react-roulette-board";

const PinComponent = () => {
  return (
    <div
      style={{
        width: 100,
        height: 100,
        borderRadius: "50%",
        backgroundColor: "red",
        display: "flex",
        alignItems: "center",
        justifyContent: "center",
        fontWeight: "bold",
        color: "#FFFFFF",
      }}
    >
      START
    </div>
  );
};

const App = () => {
  return (
    <RouletteBoard
      size={8}
      targetIndex={2}
      rotateCount={30}
      onStart={false}
      onEnd={({ index, degree }) => {
        console.log("end", index, degree);
      }}
      width={300}
      height={300}
      backgroundImageSrc="https://example.com/assets/testImage.png"
      pinComponent={<PinComponent />}
    />
  );
};

Props

PropRequiredDefaultTypeDescription
size⭕️2numberThe number of roulette compartment
targetIndex⭕️0numberTarget Index
rotateCount30numberThe number of roulette to rotate
onStart⭕️falsebooleanStart to rotate
onEnd-({ index: number, degree: number}) => voidExecuted when the roulette is finished
width300numberThe width of the roulette board
height300numberThe height of the roulette board
backgroundImageSrc⭕️""stringImage to be put on the roulette board
pinComponent-nodeChildren elements for pin
0.1.14

12 months ago

0.1.13

12 months ago

0.1.12

12 months ago

0.1.11

12 months ago

0.1.9

12 months ago

0.1.8

12 months ago

0.1.7

12 months ago

0.1.6

12 months ago

0.1.5

12 months ago

0.1.4

12 months ago

0.1.3

12 months ago

0.1.2

12 months ago

0.1.0

12 months ago