Kinetik UI

Slot Text

.md

Text that changes like a slot machine: each character spins through its own kind and brakes onto the new one.

v1.0.0Live on webreact-native-reanimatedreact-native-worklets
Component preview

Installation

Kinetik CLI
npx kinetik-ui add slot-text

The CLI copies the source and installs native dependencies with npx expo install, so versions match your Expo SDK. With shadcn: npx shadcn@latest add https://kinetik-ui.dev/r/slot-text.json

Install manually

  1. Install dependencies
    npx expo install react-native-reanimated react-native-worklets
  2. Copy the source files
    • components/kinetik/slot-text.tsx
    View source files

Usage

import { SlotText } from '@/components/kinetik/slot-text';

<SlotText text={`$${total.toLocaleString('en-US')}`} />;

When to use

  • A short figure or word that changes at a moment worth noticing: a reward, a score, a result, a code being revealed.
  • Headlines that cycle through a few words.

When not to use

  • Numbers that change often or continuously, such as a live price. Use Odometer, which rolls without spinning.
  • Long sentences. Every character is its own reel.

Notes

  • Each reel spins through glyphs of the same kind as its new character (digits for digits, letters for letters), so a number never flashes letters.
  • Reels start left to right stagger ms apart and their widths ease to fit the characters they land on; extra reels spin away to nothing.
  • The whole text is read once by screen readers; the reels are hidden.
  • With reduced motion the new text appears at once.

Props

SlotTextProps

PropTypeDefaultDescription
textrequiredstring—The text. Change it and every reel spins to its new character.
textStyleStyleProp<TextStyle>—Style for the characters. Defaults to a large, bold line in the theme text colour.
spinsnumber6Characters each reel passes on the way. Defaults to 6.
staggernumber45Delay between one reel and the next, in ms. Defaults to 45.
accessibilityLabelstring—Read by screen readers. Defaults to the text.
testIDstring—
styleStyleProp<ViewStyle>—

Performance and accessibility

Performance

Budget
One small text strip per character, moved by one transform; widths are measured once per character. Spin strips are dropped when the reels stop.
Measured

Pixel 9 emulator, API 35, release build · interaction median 1.00× the system Settings app on the same emulator (indicative only) · no frames drawn at rest · 160 MB app memory. Spikes are the first frame of a spin, when every reel lays out its strip of glyphs.

Real-device measurement pending.

Accessibility

Reduced motion
The new text appears at once.
Screen readers
Reads the whole text once; the reels are hidden.
Touch target
Not interactive.

Source files

components/kinetik/slot-text.tsx is in the Code tab of the preview above.