Skip to content
VenusUI
Get started

Prize Wheel

A spin-to-win wheel that eases to a stop while its pointer ticks past each segment.

Preview

Installation

npx shadcn@latest add @venusui/prize-wheel

Run this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.

Files added to your project

Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.

  • @/components/ui/prize-wheel.tsx

Usage

The code behind the preview above.

prize-wheel-demo.tsx

import { PrizeWheel } from "@/components/ui/prize-wheel"

export default function PrizeWheelDemo() {
  return (
    <PrizeWheel
      className="w-[min(20rem,calc(100vw-3rem))]"
      segments={[
        { label: "10% off", color: "#f43f5e" },
        { label: "Free tote", color: "#f59e0b" },
        { label: "5% off", color: "#10b981" },
        { label: "Free ship", color: "#3b82f6" },
        { label: "20% off", color: "#a855f7" },
        { label: "Sticker", color: "#14b8a6" },
        { label: "15% off", color: "#ec4899" },
        { label: "Mystery", color: "#6366f1" },
      ]}
    />
  )
}

API reference

PropTypeDefaultDescription
segments{ label: string; color: string }[]—Wheel segments, clockwise from the top.
picknumber—Index to land on; random when unset. Set it from your server for real prizes.
onResult(segment, index) => void—Called when the wheel stops.
durationnumber5200Spin time in ms.

All <div> props.

Requirements

  • React 19 and Tailwind CSS v4.

Customization

  • Keep labels short (about 10 characters) so they fit the segments.

Accessibility

  • “Spin” is a button; the result is announced (“You won: 10% off!”).
  • With reduced motion the result shows straight away.

Troubleshooting

People can win anything by inspecting the page.
The wheel only animates; decide prizes on your server and pass the result in pick.
Unknown registry "@venusui"
Your shadcn CLI couldn’t find the namespace in the shadcn registry index. Use the latest CLI (npx shadcn@latest), install by URL, or register it with its address: npx shadcn@latest registry add @venusui=https://venusui.com/r/{name}.json.
No components.json found
Run npx shadcn@latest init in your project first.
Loading preview

A card that tilts in 3D toward the pointer with spring physics.

Loading preview

Camera Shutter

Interactive

A lens with a working iris: blades close to the chosen aperture and snap shut when you release the shutter.

Loading preview

Stacked cards with the next ones peeking out; Next sends the top card to the back.