# Streaming Text

AI reply that appears word by word as it streams in, with the newest words softly highlighted. Screen readers hear the full answer once instead of every fragment.

> Composed · Pro · Feedback — React Native, Expo Go compatible.

## Install

```bash
npx @lumioui/cli add pro/streaming-text
```

## Import

```tsx
import { StreamingText, useStreamSimulation } from "@/components/ui/streaming-text/streaming-text";
```

## Variants

- `assistant` — Assistant: `npx @lumioui/cli add pro/streaming-text-assistant`
- `greeting` — Greeting: `npx @lumioui/cli add pro/streaming-text-greeting`
- `summary` — Summary: `npx @lumioui/cli add pro/streaming-text-summary`

## Props

| Prop | Type | Notes |
| --- | --- | --- |
| `text` | `string` | The reply so far. Append to it while streaming; replace it to restart. |
| `streaming?` | `boolean` | More text is still coming — shows the tail caret. Default false. |
| `onDone?` | `() => void` | Fires once when streaming has ended and every word has landed. |
| `speed?` | `"normal" | "fast"` | Word cadence: "normal" ≈ 50ms between words, "fast" ≈ 25ms. |
| `animateOnMount?` | `boolean` | Animate text that is already complete on mount. Default true; false  renders it instantly (e.g. history messages). |
| `caret?` | `boolean` | Light the writing edge: new words arrive lit in the accent and cool to  ink, and three waiting dots hold the empty line before the first word.  Default true. Words cool to the foreground ink — if `textClassName` sets  another text colour, pass false. |
| `announce?` | `boolean` | Announce the full reply to screen readers when done. Default true. |
| `streamingLabel?` | `string` | Screen-reader label while the reply is still streaming. |
| `className?` | `string` | Container classes (paragraph gap, width). |
| `textClassName?` | `string` | Type classes applied to every word — set size AND leading together. |

Source: https://lumioui.com/components/streaming-text