Streaming Text

Minimal AI text streaming with a magic-ink effect: each word fades in wearing a blue gradient, then settles into the theme's foreground once it lands.

Installation

npx shadcn@latest add @iconiq/streaming-text

File Structure

Usage

import { StreamingText } from "@/components/ui/streaming-text";

export function AssistantReply() {
  return (
    <StreamingText
      className="text-sm leading-relaxed"
      text="Design is not just what it looks like — design is how it works."
    />
  );
}

Props

Props
Description

StreamingText

text

The full text to stream in word by word. Newlines are preserved as paragraph breaks, each costing one streaming tick so paragraphs read as a natural beat. Changing it restarts the stream from the first word.

Type string

speed

Milliseconds between each word appearing.

Type number·Default 120

delay

Milliseconds to wait before the first word appears.

Type number·Default 0

settleDelay

How long a word wears the blue gradient before settling into the theme foreground, in milliseconds. The default keeps the blue trail to a handful of words; raise it for a longer trail behind the stream head.

Type number·Default 300

showCursor

Show a small pulsing gradient dot riding the stream head while words are still landing. It pops away when the stream completes.

Type boolean·Default true

onComplete

Called exactly once, on the tick that reveals the last word. Under reduced motion it fires immediately, since the full text is already visible.

Type () => void

className

Extra classes for the wrapping span.

Type string

Registry bundle

Install the exact registry entry shown on the right when you want the component file and its declared runtime dependencies together.

Dependencies: motion.

Contact

Additionally, if you find any bug or issue, feel free to raise an issue.

What makes a great interface feel alive?
Great interfaces feel alive because every word earns its place — arriving softly, settling quietly, and leaving the reader with nothing but the message.