Ballmac UI home

Word Rotate

Cycles one word of a sentence with a vertical slide and blur while its width springs to the next word, so the rest of the line reflows smoothly. Screen readers hear one stable sentence.

v3.0 · now with branch previews

Ship faster, safer, together
without the pager.

Previews, rollbacks and logs in one calm place, so releases stop being events.

Installation

$ pnpm dlx shadcn@latest add @ballmac/word-rotate

Usage

import { WordRotate } from "@/components/ballmac/word-rotate"

The full example is in the Code tab above.

Examples

Inline highlight

Built for designers, engineers, founders, support teams who sweat the details.

API reference

PropTypeDefault
words*

Words to cycle through, in order.

string[]—
interval

Milliseconds each word stays before the next slides in.

number2400
paused

Stop on the current word.

booleanfalse
wordClassName

Class names for each word (color, gradient, weight).

string—
srText

What screen readers hear instead of the changing word. Defaults to the words joined with commas, so the sentence reads once, completely, without live announcements.

string—

Also accepts the standard attributes of its root element.

Use with AI

Place <WordRotate words={["faster", "safer"]} /> inside a heading or paragraph; it inherits the font. Style the words with wordClassName (gradients, highlights). The accessible text is srText or the words joined with commas; the animated part is aria-hidden and not a live region. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Word Rotate (@ballmac/word-rotate) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Hero headlines that name several audiences or benefits
  • Short inline highlights in a tagline

Not for

  • Information people must read in full (rotating text is easy to miss)
  • Long phrases or more than about five options

Registry JSON: https://ui.ballmac.com/r/word-rotate.json

Credits

Free to use in personal and commercial projects.