ValyroUI English version

Streaming Text

Плавный вывод потока токенов. Pro · ИИ: чат и агенты › Чат

Установка

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';

Пропсы

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.

Похожие компоненты

Назад: Message Branches · Далее: Markdown Preview · Весь раздел «ИИ: чат и агенты»