Hulian UIv0.93.5413 components0 components
  • Start
  • Components
  • Blocks
  • Pages
  • Demos
  • Changelog
ChineseEnglish
  • ComponentsComponents
  • ThemeTheme

Conversation

  • Conversation
  • ChatMessage
  • PromptInput
  • TypingDots

Reasoning and Tools

  • ThinkingBlock
  • ToolCall
  • AgentPlan
  • Dossier
  • Artifact
  • ConfirmCard
  • ThreadList
  • TaskRunner

Assistance

  • StreamingText
  • PromptSuggestions
  • MessageActions
  • Citation

StreamingText

streaming-text

Renders parent-accumulated text with a blinking trailing cursor while streaming.

Usage

Streaming (trailing cursor)

When streaming is true, a blinking cursor is appended to the end, and the text grows with token.

Hulian stands on the shoulders of Base UI, TanStack, Recharts|

tsx
<p className="text-sm leading-relaxed">
  <StreamingText text="Hulian stands on the shoulders of Base UI, TanStack, Recharts" streaming />
</p>

Completed (remove cursor)

streaming is false / When omitted, the cursor is not rendered, as the final static text.

Hulian supports light and dark dual themes with 0 flicker.

tsx
<p className="text-sm leading-relaxed">
  <StreamingText text="Hulian supports light and dark dual themes 0 flashing." />
</p>

Keep line breaks

whitespace-pre-wrap built-in, line breaks in the text are preserved intact.

First line Second line Third line|

tsx
<StreamingText text={"First row\nSecond row\nThird row"} streaming />

Custom cursor

cursor slot replaces the default vertical bar, for example with a "▍" block cursor.

Generating answer▍

tsx
<StreamingText
  text="Generating answer"
  streaming
  cursor={<span className="ml-0.5 text-primary">▍</span>}
/>

When to Use

Renders an accumulated text driven by an SSE/fetch stream that grows as tokens arrive, displaying a trailing blinking cursor while in progress. Different from TypingAnimation (internal self-driven timing word-by-word typing), this component does not create words by itself - it only renders the text passed in by the parent, and the cursor is controlled by streaming.

Import

ts
import { StreamingText } from "@hulianui/ui"

Props

Inherits HTMLAttributes<HTMLElement>, additionally:

NameTypeDefaultDescription
text*string-Current accumulated text (increased by parent as token arrives)
streamingboolean-Streaming in progress: trailing flashing cursor; cursor removed after done
asElementType"span"Render Tag

Slots

SlotTypeDescription
cursorReactNodeCustom cursor node (default flashing vertical line)

Usage Guidelines

  • This component does not generate or reveal text itself. The parent must append tokens to text; passing complete static text renders it immediately.
  • Be sure to set streaming to false at the end of streaming, otherwise the cursor will keep flashing.
  • Keep the accumulated text stable across reconnects to avoid visibly replaying or dropping tokens.

Related

PromptSuggestions · MessageActions · Citation · Conversation · ChatMessage · PromptInput

PreviousTaskRunnerAI AgentsNextPromptSuggestions

On this page

  • Usage
  • Documentation
    • When to Use
    • Import
    • Props
    • Slots
    • Usage Guidelines
    • Related