entrances

SlotMachineRoll

Each character spins down a reel of glyphs and lands on its target, settling on the house spring, staggered left-to-right. Filler glyphs are seeded (deterministic). Best on short numeric strings.

$ npx ondajs add slot-machine-roll

SlotMachineRoll

Each character spins down a reel of glyphs and lands on its target, settling on the house spring — staggered left-to-right so the string resolves like an odometer. The filler glyphs come from a seeded PRNG (seededRandom), so the spin is identical every render (§1). Best on short numeric strings (years, counts, prices); defaults to a monospace stack so the reels stay column-aligned.

Props

PropTypeDefaultNotes
textstring"2026"Text that rolls in.
delaynumber0Frames before rolling.
charDelaynumber4Frames between chars starting.
durationnumber24Frames per reel to settle.
reelLengthnumber12Filler glyphs before the target.
seednumber7Deterministic filler seed.
charsetstring"0123456789"Glyph pool the reel spins.
colorstring#F2F2F4Text color.
fontSize / sizenumber / role140Explicit px or canvas-aware role.
fontFamily, fontWeight, letterSpacing, alignmono defaultsTypography vocabulary.
placementregion or {x,y,anchor}Canvas placement.

Usage

TSX
import { SlotMachineRoll } from './components/onda/slot-machine-roll/SlotMachineRoll';

export const YearScene = () => (
  <SlotMachineRoll text="2026" placement="center" />
);