mayurrawte

Streaming Text

AI chats 4

About

A set of pure-CSS text primitives for animating AI chat responses as they stream in — a blinking cursor, fade-in words/lines, and a shimmering skeleton loader.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Streaming Text to your project and fits it to your theme.

Code

How Streaming Text is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import {
  StreamingText,
  StreamingTextLine,
  StreamingTextSkeleton,
  StreamingTextSkeletonLine,
} from "@/components/ui/streaming-text";

export default function StreamingTextDemo() {
  return (
    <div className="flex flex-col gap-6 w-full max-w-lg">
      <div>
        <p className="text-xs text-muted-foreground mb-2">
          Streaming with cursor
        </p>
        <StreamingText>
          <StreamingTextLine style={{ animationDelay: "0s" }}>
            CSS cascade layers give you more control over specificity.
          </StreamingTextLine>
          <StreamingTextLine style={{ animationDelay: "0.2s" }}>
            They allow you to define explicit layers of specificity.
          </StreamingTextLine>
        </StreamingText>
      </div>

      <div>
        <p className="text-xs text-muted-foreground mb-2">Loading skeleton</p>
        <StreamingTextSkeleton>
          <StreamingTextSkeletonLine />
          <StreamingTextSkeletonLine />
          <StreamingTextSkeletonLine />
        </StreamingTextSkeleton>
      </div>
    </div>
  );
}

Dependencies

More by mayurrawte

View all
  • Feedback Buttons

    Feedback Buttons

    4
  • MCP Scope Inspector

    MCP Scope Inspector

    2
  • Tooltip

    Tooltip

    2
  • Accordion

    Accordion

    2
  • Skeleton

    Skeleton

    2
  • Loader

    Loader

    2
  • Dialog

    Dialog

    1
  • Select Dropdown

    Select Dropdown

    1

More in AI chats

View all
  • Agent Chat

    Agent Chat

    21
  • AI Suggestions

    AI Suggestions

    27
  • AI Actions

    AI Actions

    372
  • Interactive LLM Token & Context Window Visualizer

    Interactive LLM Token & Context Window Visualizer

    30
  • Aquarium Prompt

    Aquarium Prompt

    223
  • Message Parts

    Message Parts

    11
  • AI SaaS Workflow Hero

    AI SaaS Workflow Hero

    37
  • AI Chat Composer

    AI Chat Composer

    22