---
title: "Text Spin Rolling"
description: "When the text changes, each letter spins through copies of itself to the new letter."
url: https://gelatinui.com/components/text-spin-rolling
markdown_url: https://gelatinui.com/components/text-spin-rolling.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/text-spin-rolling"
version: "2026-11-15"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Text Spin Rolling

> When the text changes, each letter spins through copies of itself to the new letter.

Page: https://gelatinui.com/components/text-spin-rolling

## When to use it

Best for: A short text that changes in place and should roll letter by letter, as a slot machine.

- 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.

## When not to use it

- For the same effect with another look, use [Text Slot Rolling](https://gelatinui.com/components/text-slot-rolling.md).
- For a number that should roll digit by digit with its format, use [Rolling Number](https://gelatinui.com/components/rolling-number.md).

## Notes for agents

- Spin Rolling Text owns its look: it builds on Rolling Text and takes every other Rolling Text prop and part.
- `children` must be a string.
- Text over 40 letters, and Arabic, roll by word; set `granularity` to choose.
- A column that is still rolling goes straight to the new letter with its speed: 30 changes a second are fine.
- A word breaks only after a space, so a long heading wraps as plain text does.
- The text cannot be selected: it is a moving effect.

## Anatomy

```text
TextSpinRolling
```

## API reference

### TextSpinRolling

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `locale` | `string` |  | The BCP 47 locale for the letter and word split (`Intl.Segmenter`). Default: the `DisplayLocaleProvider` locale, else `"en-US"`. |
| `children` | `string` |  | The text to show. A new text rolls each letter column from its old letter to the new one. |
| `trigger` | `"none" \| ViewEntryTrigger` |  | 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` | `TextGranularity` |  | `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. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| TextSpinRolling | `text-spin-rolling` |  |  |  |

## Usage

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

```tsx title="upload-status.tsx"
import { TextSpinRolling } from "@/components/pro/text/text-spin-rolling";

type UploadStep = "queued" | "uploading" | "processing" | "ready";

const LABELS: Record<UploadStep, string> = {
  queued: "Queued",
  uploading: "Uploading",
  processing: "Processing",
  ready: "Ready",
};

export function UploadStatus({ step, fileName }: { step: UploadStep; fileName: string }) {
  return (
    <div className="flex items-center justify-between gap-4 rounded-lg border px-4 py-3">
      <span className="truncate text-sm">{fileName}</span>
      <span className="text-sm font-medium text-muted-foreground">
        <TextSpinRolling trigger="none" order="start">
          {LABELS[step]}
        </TextSpinRolling>
      </span>
    </div>
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui-pro/text-spin-rolling
```

It adds 26 registry items: 25 files, 4346 lines, and the npm packages `@base-ui/react`, `@mantine/hooks`, `@xstate/react`, `clsx`, `motion`, `tailwind-merge`, `xstate`.

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Text Slot Rolling](https://gelatinui.com/components/text-slot-rolling.md)
- [Text Alphabet Rolling](https://gelatinui.com/components/text-alphabet-rolling.md)
- [Rolling Number](https://gelatinui.com/components/rolling-number.md)
- [Count Up](https://gelatinui.com/components/count-up.md)
- [Number Text](https://gelatinui.com/components/number-text.md)

## Motion

| Part | Motion |
| --- | --- |
| 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 |
