Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Rotating Words

Pro

Cycles through words in place without shifting the text around it.

Installation

pnpm dlx shadcn@latest add @viewport/rotating-words

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above comes with Truffle Pro.

Props

PropTypeDefault
words*string[]

Words to cycle through.

—
intervalnumber

Milliseconds each word stays on screen.

2200
classNamestring—

Accessibility

  • All words are announced once as a list; the animation is aria-hidden.
  • Reserves the width of the longest word to prevent layout shift.
  • Stops rotating under reduced motion.