# Rotating Text

> One slot in a sentence that keeps turning over.

We build [apps · games · tools]. The slot resizes smoothly to each word so the sentence never jumps.

- Family: Typography
- Plan: Creative. Included with Creative.
- Requires: React, Tailwind CSS v4 and the motion package
- Page with a live preview: https://galactrex.com/ui/rotating-text/
- Licence: https://galactrex.com/ui/license/

## Install

```sh
npx @galactrex/ui login   # once, with an API key from https://galactrex.com/account/
npx @galactrex/ui add rotating-text
```

It installs to `components/galactrex/rotating-text.tsx`, with the shared motion helpers beside it. First time in a project: `npx @galactrex/ui init` (setup guide: https://galactrex.com/docs/ui-components-setup/).

## Usage

```tsx
import { RotatingText } from "@/components/galactrex/rotating-text";

We build <RotatingText words={["apps", "games", "tools"]} />
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `words` | `string[]` | — | The words. |
| `every` | `number` | `2.2` | Seconds per word. |
| `mode` | `"flip" \| "slide"` | `"flip"` | Drum flip or slide. |
| `className` | `string` | — | Extra classes for the outer element. |

## Variants

- **Inline.** Inside a sentence.

## Accessibility

- The word list is read once.

## Motion

- Spring 3D flip with layout resize; pauses offscreen.
- Reduced motion: a fade.
