A customizable, open-source spin wheel application built with Next.js and React. Perfect for giveaways, prize draws, decision making, or any interactive spinning wheel needs.
- π¨ Fully Customizable - Colors, branding, and styling
- π Dark/Light Mode - Built-in theme switching
- π΅ Sound Effects - Optional audio feedback
- π± Responsive Design - Works on desktop and mobile
- β‘ Fast & Modern - Built with Next.js 15 and React 19
- π Winner Announcements - Animated winner display
- π Participant Management - Easy import/export/delete of participants
- ποΈ Flexible Deletion - Remove individual participants, winners, or entire categories
- βοΈ Configurable Features - Enable/disable any feature via configuration
- π Gradient Colors - Beautiful auto-generated color schemes
- πΎ Persistent Storage - Never lose your participants or winners data
- Node.js 18+
- npm, yarn, pnpm, or bun
-
Clone the repository
git clone https://github.com/hadihaider055/spin-wheel-of-names.git cd spin-wheel-of-names -
Install dependencies
npm install # or yarn install # or pnpm install
-
Run the development server
npm run dev # or yarn dev # or pnpm dev
-
Open your browser Navigate to http://localhost:3000
Create a config/app.config.js file in your project root:
export const appConfig = {
title: "My Spin Wheel",
description: "Win amazing prizes!",
theme: {
primaryColor: "#3b82f6",
secondaryColor: "#10b981",
backgroundColor: "#ffffff",
textColor: "#1f2937",
},
wheel: {
spinDuration: 3000,
enableSound: true,
segments: 8,
},
winner: {
showConfetti: true,
displayDuration: 5000,
},
};Create a .env.local file:
# App Configuration
NEXT_PUBLIC_APP_TITLE="Spin Wheel of Names"
NEXT_PUBLIC_ENABLE_SOUND=true
NEXT_PUBLIC_PRIMARY_COLOR="#3b82f6"
# Optional: Custom branding
NEXT_PUBLIC_LOGO_URL="/your-logo.png"
NEXT_PUBLIC_FAVICON_URL="/your-favicon.ico"βββ public/ # Static assets
β βββ sounds/ # Audio files
β βββ images/ # Logo and images
βββ src/
β βββ app/ # Next.js app directory
β β βββ globals.css # Global styles
β β βββ layout.tsx # Root layout
β β βββ page.tsx # Home page
β βββ components/ # Reusable components
β β βββ common/ # Common UI components
β βββ containers/ # Page containers
β β βββ SpinWheel/ # Main spin wheel component
β β βββ GiftSection/ # Prize/gift display
β β βββ WinnerAnnouncement/ # Winner display
β βββ utils/ # Utilities and helpers
β βββ functions/ # Helper functions
β βββ hooks/ # Custom React hooks
β βββ types/ # TypeScript type definitions
βββ config/ # Configuration files
βββ docs/ # Documentation
The application automatically saves your data locally in your browser:
- Participants: All added participants are saved and restored when you return
- Winners History: Previous winners are remembered across sessions
- Settings: Your customizations and preferences persist
- No Account Required: Everything works offline in your browser
- Uses browser's
localStoragefor data persistence - Automatically saves when participants are added/removed
- Winners history limited to last 10 entries for performance
- Data persists until you clear browser data or use "Full Reset"
Simply paste a list of names in the input field:
John Doe
Jane Smith
Bob Wilson
Alice Johnson
Or format with categories and grades:
John Doe (Grade A, Sales Team)
Jane Smith (Grade B, Marketing Team)
Participants:
- Individual Delete: Hover over any participant and click the trash icon
- Category Delete: Click "Clear" button next to any category name
- Clear All: Click "Clear All" button to remove all participants
- Bulk Import: Paste multiple names at once in the input field
Winners:
- Individual Delete: Hover over any winner and click the trash icon
- Clear All Winners: Click "Clear All" button in winners section
- Persistent History: Winners are saved across sessions (last 10)
const wheelConfig = {
segments: participants.length,
colors: ["#FF6B6B", "#4ECDC4", "#45B7D1", "#96CEB4"],
spinDuration: 4000,
enableSound: true,
};Control which features are available in your app:
// config/app.config.js
features: {
darkModeToggle: true, // Show/hide dark mode button
exportResults: true, // Enable result export functionality
historyTracking: true, // Save winners history
customColors: true, // Allow color customization
importParticipants: true, // Allow bulk participant import
// Deletion Features (NEW)
deleteParticipants: true, // Individual participant delete buttons
deleteWinners: true, // Individual winner delete buttons
clearAllParticipants: true, // "Clear All" button for participants
clearAllWinners: true, // "Clear All" button for winners
categoryManagement: true, // Category-level "Clear" buttons
}# Disable specific features for production
NEXT_PUBLIC_ENABLE_DELETE_WINNERS=false
NEXT_PUBLIC_ENABLE_CLEAR_ALL_WINNERS=false
NEXT_PUBLIC_ENABLE_CATEGORY_MANAGEMENT=falseThe app supports full theme customization through CSS variables and configuration files. See CUSTOMIZATION.md for detailed instructions.
- Add your audio files to
public/sounds/ - Update the configuration to reference your files
- Ensure files are in supported formats (MP3, WAV, OGG)
Modify the spin wheel animations by editing the CSS in src/containers/SpinWheel/index.tsx.
- Push your code to GitHub
- Connect your repository to Vercel
- Deploy with one click
The app can be deployed to any platform that supports Next.js:
- Netlify:
npm run build && npm run export - Railway: Direct deployment from Git
- Docker: Use the included Dockerfile
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes and test thoroughly
- Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLint
Wheel not spinning: Check that participants are loaded and the wheel is not already spinning.
Sound not playing: Ensure enableSound is set to true and audio files are in the correct directory.
Styling issues: Verify your CSS customizations and check browser console for errors.
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Next.js
- Icons from Lucide React
- Styled with Tailwind CSS
- π Report a bug
- π‘ Request a feature
- π View documentation
Made with β€οΈ by Hadi Haider