Account

Originals

Creative

Slot Reel

Change the value and it spins, slows, overshoots a hair and settles. For picking a winner, random suggestions, prize draws and 'spin for a name'.

Install

Included with Creative: needs your API key. Initialize and log in once.

Terminal
npx @galactrex/ui add slot-reel

Usage

Example
import { SlotReel } from "@/components/galactrex/slot-reel";

<SlotReel items={names} value={winner} onLand={celebrate} />

Source

Installs to components/galactrex/slot-reel.tsx, with the shared motion primitives beside it.

Source for this component comes with its plan. Install it with the command above, or open your licensed copy here.

See plans

Props

PropTypeDefaultDescription
itemsstring[]—What it can land on.
valuestring—Where it lands; change it to spin.
spinsnumber3Full turns before landing.
durationnumber1.6Seconds per spin.
onLand(value: string) => void—Called when it stops.
classNamestring—Extra classes for the outer element.

Variants

  • Winner. Names from a giveaway.
  • Triple. Three reels with staggered durations.

Accessibility

  • The landed value is announced once through a polite live region.

Motion and reduced motion

  • One transform on the strip with an overshooting ease.
  • Reduced motion: lands at once.