New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

react-royale-spinner

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-royale-spinner

A premium, physics-based spinning wheel component for React applications.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

React Royale Spinner 👑

The Ultimate Wheel of Fortune Component for React.
Create engaging, premium-quality "Spin to Win" experiences with modern physics animations, procedural audio, and endless customization.

License React TypeScript

✨ Features

  • 🎮 Physics-Based Animation: Powered by framer-motion for realistic acceleration, deceleration, and friction.
  • 🎨 Premium Aesthetics: Built-in support for gradients, shadows, and glassmorphism. Defaults to a stunning "Gold & Luxury" theme.
  • 🔊 Procedural Audio: Integrated Web Audio API engine generating "tick" and "win" sounds without large assets.
  • 🎊 Celebration Effects: Automatic confetti explosion on win (powered by canvas-confetti).
  • 🔧 Fully Customizable: Control every aspect—from rim colors to pointer design, fonts, and segment styles.
  • 📱 Responsive & Accessible: scalable SVG graphics and ARIA support.

📦 Installation

npm install react-royale-spinner framer-motion canvas-confetti clsx
# or
yarn add react-royale-spinner framer-motion canvas-confetti clsx

🚀 Quick Start

import { SpinWheel, WheelItem } from 'react-royale-spinner';
import 'react-royale-spinner/dist/react-royale-spinner.css';

const items: WheelItem[] = [
  { id: 1, label: 'iPhone 15', color: '#e74c3c', textColor: '#fff' },
  { id: 2, label: '$50 Cash', color: '#f1c40f', textColor: '#000' },
  { id: 3, label: 'Free Spin', color: '#3498db', textColor: '#fff' },
  { id: 4, label: 'Better Luck', color: '#95a5a6', textColor: '#fff' },
];

function App() {
  return (
    <SpinWheel 
      items={items} 
      onSpinFinish={(result) => alert(`You won: ${result.label}`)} 
    />
  );
}

🎨 Professional Customization ("Gaming King" Theme)

Create a high-end casino or gaming feel with custom gradients and pointers:

<SpinWheel 
  items={items}
  size={500}
  // Gold & dark luxury theme used in casinos
  primaryColor="conic-gradient(from 0deg, #f1c40f, #b8860b, #f1c40f, #b8860b)"
  secondaryColor="radial-gradient(circle, #f1c40f, #b8860b)"
  rimStyle={{ 
      border: '8px solid #4a3b00',
      boxShadow: '0 0 30px rgba(241, 196, 15, 0.4)'
  }}
  pointerProps={{
      src: '/path/to/custom-jewel-pointer.png', // Or use style object for CSS shape
      style: { width: 60, height: 80, top: -30 }
  }}
  fontFamily="'Cinzel', serif"
/>

⚙️ Props API

PropTypeDefaultDescription
Core
itemsWheelItem[]RequiredArray of segments (see WheelItem type).
onSpinFinish(item) => void-Callback fired when the wheel stops.
sizenumber300Diameter of the wheel in pixels.
spinDurationnumber4Duration of the spin in seconds.
Visuals
primaryColorstringGold GradientBackground/rim of the wheel container. can be a gradient string.
secondaryColorstringGold GradientBackground of the center knob.
rimStyleCSSProperties-Override style object for the outer rim container.
pointerPropsobject-Customize the pointer { src, style, color }.
Typography
fontFamilystringArialCSS font-family for segment labels.
fontSizenumber14Font size (responsive auto-scaling available).
textColorstring#fffDefault text color if not specified in WheelItem.
Features
disableSoundbooleanfalseTurn off procedural sound effects.
disableConfettibooleanfalseTurn off the confetti celebration effect.
Development
debugResultnumber-Force a specific segment index (0-based) to win.

WheelItem Type

interface WheelItem {
  id: string | number;
  label: string;
  color: string;      // Segment background color
  textColor?: string; // Optional override for this segment
  style?: CSSProperties; // Advanced style overrides
}

📜 License

Apache 2.0 © [Your Name/Company]

Built with ❤️ for the React Community.

Keywords

react

FAQs

Package last updated on 31 Dec 2025

Did you know?

Socket

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.

Install

Related posts