
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-roulette-flip
Advanced tools
A React library for random selection using two interactive components:
A React library for random selection using two interactive components:
A spinning wheel that selects a random item from a list.
A sliding deck of cards that reveals a random choice.
Important: To ensure the styles for react-roulette-flip work correctly, you need to import the CSS file in your main.css (or your main CSS entry point). Add the following line to your main.css:
import "react-roulette-flip/dist/react-roulette-flip.css";
npm install react-roulette-flip
# or
yarn add react-roulette-flip
# or
pnpm add react-roulette-flip
import { useState } from "react";
import { RouletteWheel } from "react-roulette-flip";
const options = ["Alice", "Bob", "Charlie", "David"];
function App() {
const [startSpin, setStartSpin] = useState(false);
const handleStopSpin = (index: number, text: string, allDrawsCompleted?: boolean) => {
setStartSpin(false);
alert(`Spin stopped at index ${index}: ${text}`);
};
return (
<div>
<button onClick={() => setStartSpin(true)}>Start Spin</button>
<RouletteWheel
data={options}
startSpin={startSpin}
onStopSpin={handleStopSpin}
/>
</div>
);
}
export default App;
| Prop | Type | Default | Description |
|---|---|---|---|
data | string[] | [] | List of names or items to pick from. |
startSpin | boolean | false | Controls whether the wheel starts spinning. When true, the wheel will spin. |
onStopSpin? | (index: number, text: string) => void | undefined | Callback triggered when the wheel stops spinning. It provides the index and the selected item from the wheel. |
size | number | 400 | Diameter of the wheel. |
removeOnSelect? | boolean | false | Determines if the selected segment should be removed after being chosen. |
backgroundColor? | string | "#181818" | Sets the background color of the wheel. |
segmentColors? | string[] | ["#32A3FF", "#84BC23"] | An array of colors for the individual segments of the wheel. |
borderOuterWidth? | number | 2 | The width of the outer border of the wheel. |
borderOuterColor? | string | "#FFFFFF" | The color of the outer border of the wheel. |
borderInnerWidth? | number | 1 | The width of the inner border of the wheel. |
borderInnerColor? | string | "#FFFFFF" | The color of the inner border of the wheel. |
centerPointColor? | string | "#FFFFFF" | The color of the center point of the wheel. |
pointerColor? | string | "#FF0000" | The color of the pointer (indicator) used to select a segment. |
fontColor? | string[] | ["#FFFFFF"] | Specifies the color of the text displayed on the segments of the wheel. |
hasShadow? | boolean | true | Determines if the wheel should have a shadow effect. |
import { useState } from "react";
import { FlipCard } from "react-roulette-flip";
const data = [
{ name: "Alice", description: "A brilliant coder", url: "https://alice.com" },
{ name: "Bob", description: "A passionate developer", url: "https://bob.com" },
{ name: "Charlie", description: "A tech enthusiast", url: "https://charlie.com" },
{ name: "David", description: "A software architect", url: "https://david.com" },
];
function App() {
const [startSpin, setStartSpin] = useState(false);
const handleStopSpin = (index: number, text: string, allDrawsCompleted?: boolean) => {
setStartSpin(false);
alert(`Card stopped at index ${index}: ${text}`);
};
return (
<div>
<button onClick={() => setStartSpin(true)}>Start Spin</button>
<FlipCard
data={data}
startSpin={startSpin}
onStopSpin={handleStopSpin}
/>
</div>
);
}
export default App;
| Prop | Type | Default | Description |
|---|---|---|---|
data | IBoxData[] | [] | Array of data objects to populate the flip card, each containing name, description, and url. |
startSpin | boolean | false | Controls whether the card selection starts spinning. |
onStopSpin | (index: number, text: string, allDrawsCompleted?: boolean) => void | undefined | Callback function triggered when the card stops spinning, providing the index, text, and whether all draws are completed. |
backgroundColor | string | "#1b1b1b" | The background color of the flip card. |
borderOuterWidth | number | 3 | The outer border width of the card. |
borderOuterColor | string | "#4886c7" | The outer border color of the card. |
hasFrame | boolean | false | Determines whether the winning card has a frame. |
frameColor | string | "#396ba0" | The color of the card’s frame (only if hasFrame is true). |
pointerColor | string | "#edcb31" | The color of the pointer or indicator. |
cardColor | string | "#1c95f1" | The color of the flip card background. |
removeOnSelect | boolean | false | Removes the selected item from the list once it has been selected. |
interface IBoxData {
name: string;
description?: string;
url?: string;
color?: string
}
homepage URL in package.json.react-roulette-flip.RouletteWheel with winner banner and FlipCard with color customization.New Feature: Added color property to IBoxData interface for customizing card colors. Improvement: Enhanced performance of FlipCard animations. Bug Fix: Fixed an issue where RouletteWheel would sometimes select the same item twice in a row.
Pull requests and suggestions are welcome! Please open an issue if you find bugs or have feature requests.
MIT License ©2025 BitCoder_
FAQs
A React library for random selection using two interactive components:
We found that react-roulette-flip demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.