Streaming Text
Smooth token streaming. Pro · AI chat and agents › Chat
Smoothly reveals a token stream: whole words at a steady pace that catches up with bursts, an optional per-word fade, a caret while streaming and Markdown that stays well-formed mid-stream.
Installation
npx valyro-cli@latest login
npx valyro-cli@latest add streaming-text
npm install valyro-ui-pro
import 'valyro-ui-pro/styles.css';
import { StreamingText } from 'valyro-ui-pro';
Props
| Prop | Type | Default | |
|---|---|---|---|
text * | string | Text received so far. Append tokens as they arrive; any other change starts a new reveal. | |
streaming | boolean | false | More tokens are coming: the caret stays. |
markdown | boolean | false | Render as Markdown. Unfinished markup (**bo, half links) is closed on the fly so raw markers never flash. |
speed | number | 90 | Slowest reveal speed in characters per second; a backlog speeds it up so it never lags far behind. |
fade | boolean | true | Fade each revealed word in (plain text only). |
instant | boolean | false | Show text as soon as it arrives, without the smooth reveal. Always on with prefers-reduced-motion. |
skippable | boolean | true | Offer a Skip button while the reveal lags behind the stream. |
onComplete | () => void | Called once the reveal has caught up with a finished stream. | |
renderCitation | (index: number) => ReactNode | Turns [1] markers into nodes such as Citation chips (Markdown only). | |
labels | Partial<StreamingTextLabels> | Overrides for the built-in English text; keys left out keep their defaults. |
Related components
- AI Chat Window — AI chat window
- Chat Message — Messages with streaming output
- Message Branches — Message versions and a conversation branch tree
- Markdown Preview — Rendered Markdown
- Response Feedback — Answer rating and a rubric for reviewers
- Prompt Composer — Prompt field with attachments
- Inline Suggestion — Inline autocomplete suggestion
- Model Selector — AI model picker
- Model Comparison — Side-by-side answers from several models
- Prompt Library — Prompt library with variables
- Chain of Thought — Model reasoning steps
- Tool Call — Tool call with approval
Previous: Message Branches · Next: Markdown Preview · All AI chat and agents