# Rolling Word

> One word rolls to the next like a drum.

## Spec sheet

| | |
| --- | --- |
| Access | Free: no account, free for commercial use |
| Shelf | Text Animations › Transitions |
| Live preview | https://uibrik.com/components/rolling-word |
| Writes | 1 file into `components/uibrik/rolling-word/` |
| Packages | `motion`, `react-use-measure` (the CLI installs them) |
| Needs | React 19, Tailwind CSS v4, a project set up with `npx shadcn@latest init` |
| Theme | Reads the shadcn tokens and follows class-based dark mode ([theming](https://uibrik.com/docs/theming.md)) |
| Updated | Nov 9, 2026 |

## Add it

```bash
npx shadcn@latest add https://uibrik.com/r/rolling-word.json
```

With the `@uibrik` namespace in `components.json` ([setup](https://uibrik.com/docs/installation.md)): `npx shadcn@latest add @uibrik/rolling-word`.

Can't run commands? https://uibrik.com/components/rolling-word/prompt.txt has every file verbatim, with the setup steps, ready for an assistant to write.

## Render it

Renders as is; every value shown is the default, so delete any line you don't need.

```tsx
import { RollingWord } from "@/components/uibrik/rolling-word/rolling-word";

<RollingWord
  play={0}
  prefix="Build something"
  words={["calm", "honest", "lasting", "yours"]}
  duration={0.45}
  exitDuration={0.35}
  stagger={0.03}
/>
```

## Tune it

The same props as the Customize panel on https://uibrik.com/components/rolling-word.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `prefix` | `string` | `"Build something"` | Fixed text before the rolling word. |
| `words` | `string[]` | `["calm","honest","lasting","yours"]` | Cycled through, one per play. |
| `duration` | `number` | `0.45` | Time for a letter to roll in. |
| `exitDuration` | `number` | `0.35` | Time for a letter to roll out. |
| `stagger` | `number` | `0.03` | Delay between letters. |

## Wire it

The props the Customize panel doesn't show: ranges, data, content and callbacks.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `play` (required) | `number` |  | Each change plays the effect again; 0 shows its resting state. |
| `className` | `string` |  | Classes for the line, merged over the defaults. |

## Where it fits

- **Rotating headlines**: One word rolling to the next like a drum lets a headline speak to several audiences. Pairs with [Anagram Shuffle](https://uibrik.com/components/anagram-shuffle.md).
- **"Built for" taglines**: A rolling slot works for lines like "Built for designers, developers and teams".
- **Section titles**: A single changing word keeps a title short while covering several use cases.

## Same shelf: Transitions

- [Scatter Text](https://uibrik.com/components/scatter-text.md): Phrases shatter into particles that regroup into the next phrase.
- [Scramble to Word](https://uibrik.com/components/scramble-to-word.md): A split-flap board scrambles to the next word.
- [Slot-machine Letters](https://uibrik.com/components/slot-letters.md): Each letter spins like a reel and lands on the next word.
- [Status Stamp](https://uibrik.com/components/status-stamp.md): An ink stamp slams down: approved, in review, rejected.
- [Zoom Past](https://uibrik.com/components/zoom-past.md): Words fly toward you and the next one arrives behind.
- [Anagram Shuffle](https://uibrik.com/components/anagram-shuffle.md): Letters rearrange themselves into the next anagram.

## Ground rules

- Only the props above exist. To change anything else, edit the installed file.
- Keep the files in `components/uibrik/rolling-word/` so the import paths keep resolving.
- The playbook for working with the whole library: https://uibrik.com/llms.txt
