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
  • Select Dropdown

    Select Dropdown

    1
  • Loader

    Loader

    1
  • MCP Tool Call Card

    MCP Tool Call Card

More in AI chats

View all
  • AI Actions

    AI Actions

    361
  • Aquarium Prompt

    Aquarium Prompt

    168
  • AI Artifact

    AI Artifact

    17
  • AI Suggestions

    AI Suggestions

    22
  • AI Orb

    AI Orb

    216
  • Agent Chat

    Agent Chat

    21
  • Color Picker

    Color Picker

    229
  • AI Task List

    AI Task List

    198