Streaming text
A visible backlog. Words that arrive faster than reading pace wait as a faint run of dots after the caret, one per word, and each dot turns into its word as it lands, so you can see the model running ahead of the page.
npx shadcn@latest add @uimaxxer/streaming-textPasskeysFix the duplicate Stripe charge
The checkout test keeps failing on CI but passes locally. Can you find out why?
Streaming text is a Pro component
The demo and the docs are free. The source comes with Pro, through this page, the shadcn CLI and the MCP.
Usage
import { StreamingText } from "@/components/ui/streaming-text"
const { messages, status } = useChat()
const last = messages.at(-1)
<StreamingText text={textOf(last)} done={status === "ready"} />Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| text | string | Everything received so far. Append as tokens arrive, for example the text of the last message from useChat. | |
| done | boolean | false | Set when the stream ends. The reveal catches up, then the caret goes. |
| pace | number | 60 | Characters per second when the buffer is nearly empty. A burst drains over about 1.6s. |
| backlog | number | 14 | Most dots shown after the caret, one per word waiting. 0 hides the backlog. |
| onRevealed | () => void | Called once the last word is on screen. |
Accessibility
- The reply is an aria-live region marked aria-busy while it streams, so screen readers read it once, whole, instead of word by word.
- Reduced motion keeps the fade and drops the blur and the lift.
- The caret and the backlog dots are decorative and hidden from assistive tech.