tinkerers-labs

Streaming Text

AI chats

About

A text display that reveals content piece by piece from an async source (like an LLM response stream) or replays static text at a set speed, with a blinking cursor and sentence-level screen-reader announcements.

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

"use client";

import * as React from "react";

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

const script =
  "I checked the three files you changed. The migration looks right, but `users.email` is still nullable, so the unique index will fail on the second empty row. Want me to add the backfill first?";

export function StreamingTextDemo() {
  const [runId, setRunId] = React.useState(0);
  const [done, setDone] = React.useState(false);

  return (
    <div className="grid w-full max-w-xl gap-4">
      <StreamingText
        key={runId}
        text={script}
        speed={55}
        className="text-[0.95rem] leading-relaxed"
        onDone={() => setDone(true)}
      />

      {done ? (
        <button
          type="button"
          className="text-muted-foreground hover:text-foreground inline-flex w-fit items-center gap-1.5 text-sm underline-offset-4 hover:underline"
          onClick={() => {
            setDone(false);
            setRunId((current) => current + 1);
          }}
        >
          Replay
        </button>
      ) : null}
    </div>
  );
}

export default StreamingTextDemo;

More by tinkerers-labs

View all
  • Prompt Input

    Prompt Input

    6
  • Burst

    Burst

    2
  • Orb

    Orb

  • Transcript Viewer

    Transcript Viewer

  • Image Grid

    Image Grid

  • CSV Viewer

    CSV Viewer

  • File Tree

    File Tree

  • Message

    Message

More in AI chats

View all
  • AI Actions

    AI Actions

    319
  • Color Picker

    Color Picker

    82
  • Agent Chat

    Agent Chat

    17
  • Prompt with Model Picker

    Prompt with Model Picker

    2
  • Message Thread

    Message Thread

    36
  • System Message

    System Message

    54
  • Suggestions

    Suggestions

    28
  • Modal Card

    Modal Card

    101