# Typewriter Text

> Types, holds, deletes and types the next.

The classic typewriter with a blinking cursor, cycling phrases. For hero lines that name audiences or uses.

- 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/typewriter-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 typewriter-text
```

It installs to `components/galactrex/typewriter-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 { TypewriterText } from "@/components/galactrex/typewriter-text";

Built for <TypewriterText text={["designers", "studios", "teams"]} />
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `text` | `string \| string[]` | — | Phrase or phrases. |
| `as` | `ElementType` | `"span"` | Element. |
| `speed / deleteSpeed` | `number` | `18 / 40` | Characters per second. |
| `hold` | `number` | `1400` | Ms a phrase stays. |
| `loop` | `boolean` | `true` | Keep cycling. |
| `cursor` | `"bar" \| "block" \| "underscore" \| "none"` | `"bar"` | Cursor. |
| `className` | `string` | — | Extra classes for the outer element. |

## Variants

- **Cycling.** A list of phrases with loop.

## Accessibility

- Every phrase is read once; keystrokes are visual.

## Motion

- Text writes only.
- Reduced motion: the first phrase, no cursor.
