Skip to content

Text Slot Rolling

Free

When the text changes, each letter spins through random letters to the new one, like slot machine reels.

  • React 19
  • Tailwind CSS 4

Added Nov 15, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

Pass the text as children. A new text rolls only the letters that change.

upload-status.tsx

TextSlotRolling

<div>
PropTypeDefaultDescription
localestring—The BCP 47 locale for the letter and word split (Intl.Segmenter). Default: the DisplayLocaleProvider locale, else "en-US".
childrenRequiredstring—The text to show. A new text rolls each letter column from its old letter to the new one.
trigger"none""mount""view"—The first roll, which lands on the same text: view (default) the first time it is on screen, mount at once, or none (only a new text rolls). Before it, the text shows at rest.
order"center""edges""end""random""start"—The order in which the columns start: center (default, from the middle out), start, end, edges, or random (a fixed shuffle of each text).
direction"down""up"—up (default): the new letter comes in from below. down: from above.
granularity"grapheme""word"—grapheme: a column per letter at any length. Default: per letter up to 40 letters, else per word. A joining script (Arabic) always rolls per word.
charactersstring—The letters a column takes at random. Default: the letters of about the width of each target (capitals for a capital, digits for a digit). A letter with no default (an accent, a Greek letter) passes copies of itself.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.
  • Pass the text as children; a new text rolls only the columns whose letter changed.
  • Leave trigger at "view" for a headline that rolls once when it comes into view.
  • Set trigger="none" for a status or a value: only a new text rolls.
Roll
roll · each column rolls 5 to 7 lines to its new letter on a spring, all started within 0.25s
First roll
roll · 9 to 11 lines, 50ms apart, when the text comes into view
Width
panel · a column slides to the width of its new letter; added letters grow from 0
Fade
fade · an added letter fades in, a removed one fades out as it shrinks
  1. AddedText Slot Rolling.
Open the release