Word Rotate
Cycling text animation that rotates through an array of words.
Installation$
pnpm add @glinui/ui @glinui/tokensRegistry$
pnpm dlx @glinui/cli@latest add word-rotateUsage$
WordRotate is a "use client" component. Place it inline inside headings or body copy to cycle through a list of words with a slide-up/slide-down transition. Each word is shown for duration milliseconds before animating to the next.
Basic$
Build with
React1"use client"2import { WordRotate } from "@glinui/ui"34export function WordRotateDemo() {5return (6 <div className="flex items-center justify-center p-8">7 <h2 className="text-3xl font-bold">8 Build with{" "}9 <WordRotate10 words={["React", "Next.js", "Tailwind", "Glin UI"]}11 className="text-accent"12 />13 </h2>14 </div>15)16}
Examples$
Fast Rotation$
Lower duration for a rapid, high-energy cycling effect.
Powered by
speed1"use client"2import { WordRotate } from "@glinui/ui"34export function WordRotateFastDemo() {5return (6 <div className="flex items-center justify-center p-8">7 <h2 className="text-3xl font-bold">8 Powered by{" "}9 <WordRotate10 words={["speed", "precision", "glass", "motion"]}11 duration={1500}12 className="text-accent"13 />14 </h2>15 </div>16)17}
Accessibility$
- The component renders with
aria-live="polite"so screen readers announce each new word as it appears. - The outgoing word is removed from the DOM after its exit animation, preventing duplicate announcements.
- Surrounding static text is not affected by the live region and is read normally.
Reduced Motion$
When prefers-reduced-motion: reduce is active, word cycling stops and the first word in the words array is displayed statically without any animation.
API Reference$
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
animationDuration | number | No | 300 | Animation speed for enter/exit (ms) |
duration | number | No | 2500 | Duration each word is shown (ms) |
words | string[] | Yes | - | Array of words to cycle through |
Source$
1import { WordRotate } from "@glinui/ui"
Generated API Snapshot
Beta
Generated API Snapshot
BetaAuto-extracted from TypeScript source in packages/ui/src/components/word-rotate.tsx. This section is in beta and may lag behind hand-curated docs. Regenerate with pnpm --filter @glinui/docs api:generate.
Generated: 2026-02-19T17:59:28.468Z · Full index: /docs/api-metadata
Primary Props Type
WordRotateProps
WordRotateProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
animationDuration | number | No | 300 | Animation speed for enter/exit (ms) |
duration | number | No | 2500 | Duration each word is shown (ms) |
words | string[] | Yes | - | Array of words to cycle through |