Streaming Text
ProNewSmooths bursty token streams into an even reveal with words that fade in.
Installation
pnpm dlx shadcn@latest add @viewport/streaming-text
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
| Prop | Type | Default |
|---|---|---|
| text* | stringThe text received so far. Append to it as tokens arrive. | — |
| speed | numberCharacters revealed per second. The reveal speeds up if it falls behind. | 90 |
| streaming | booleanWhether more text is still coming. Controls the caret and `aria-busy`. | false |
| className | string | — |
Accessibility
- Sets aria-busy while streaming and announces the full text once when done.
- Shows text instantly under reduced motion.