Loading preview
Animated Card
CardsA card that tilts in 3D toward the pointer with spring physics.
A spin-to-win wheel that eases to a stop while its pointer ticks past each segment.
npx shadcn@latest add @venusui/prize-wheelRun this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.
Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.
@/components/ui/prize-wheel.tsxThe 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" },
]}
/>
)
}
| Prop | Type | Default | Description |
|---|---|---|---|
| segments | { label: string; color: string }[] | — | Wheel segments, clockwise from the top. |
| pick | number | — | Index to land on; random when unset. Set it from your server for real prizes. |
| onResult | (segment, index) => void | — | Called when the wheel stops. |
| duration | number | 5200 | Spin time in ms. |
All <div> props.
pick.Unknown registry "@venusui"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 foundnpx shadcn@latest init in your project first.A card that tilts in 3D toward the pointer with spring physics.
A lens with a working iris: blades close to the chosen aperture and snap shut when you release the shutter.
Stacked cards with the next ones peeking out; Next sends the top card to the back.