Command Palette

Search for a command to run...

AI Elements / Chat/AI Streaming Text

AI Streaming Text

Animated text that streams in character-by-character or word-by-word

Open in v0Open in

Overview

An animated text component that simulates streaming AI responses. Displays text character by character or word by word with a blinking cursor.

Installation

bunx shadcn@latest add @elements/streaming-text

Usage

import { StreamingText } from "@/components/elements/ai-elements/chat/streaming-text";

export function StreamingResponse() {
  return (
    <StreamingText
      text="This text will stream in character by character..."
      speed={30}
      showCursor
      onComplete={() => console.log("Done!")}
    />
  );
}

Props

PropTypeDefaultDescription
textstring-Text to stream
speednumber30Milliseconds per character/word
mode"char" | "word""char"Stream by character or word
showCursorbooleantrueShow blinking cursor
onComplete() => void-Callback when streaming completes
classNamestring-Additional CSS classes

Features

  • Character-by-character streaming
  • Word-by-word streaming mode
  • Configurable speed
  • Blinking cursor animation
  • Completion callback
  • Supports streamdown integration