ValyroUI Русская версия

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

PropTypeDefault
text *stringText received so far. Append tokens as they arrive; any other change starts a new reveal.
streamingbooleanfalseMore tokens are coming: the caret stays.
markdownbooleanfalseRender as Markdown. Unfinished markup (**bo, half links) is closed on the fly so raw markers never flash.
speednumber90Slowest reveal speed in characters per second; a backlog speeds it up so it never lags far behind.
fadebooleantrueFade each revealed word in (plain text only).
instantbooleanfalseShow text as soon as it arrives, without the smooth reveal. Always on with prefers-reduced-motion.
skippablebooleantrueOffer a Skip button while the reveal lags behind the stream.
onComplete() => voidCalled once the reveal has caught up with a finished stream.
renderCitation(index: number) => ReactNodeTurns [1] markers into nodes such as Citation chips (Markdown only).
labelsPartial<StreamingTextLabels>Overrides for the built-in English text; keys left out keep their defaults.

Related components

Previous: Message Branches · Next: Markdown Preview · All AI chat and agents