Skip to content
Uxelith
Sign in
Prov1.0.0AI & Agents

Streaming Answer

An AI answer that arrives like writing: tokens come in bursts but words appear at a steady pace, each sharpening into place behind a caret, after a Thinking shimmer. Light markdown; sentences announced to screen readers.

Installs with Uxelith ProHow
Licence
Pro
Packages
2
Updated
28 Oct 2026
Live

Installation

Usage

example.tsx
"use client"

import * as React from "react"

import { StreamingAnswer } from "@/components/streaming-answer"

const REPLY = "All set. Your table for **4** is held at **Toscano** on Friday at 8 pm.\n\n- Window table in the quiet section\n- Invite sent to the team"

// Stand-in for your model stream: append each chunk to `text` as it arrives.
export function Answer() {
  const [text, setText] = React.useState("")
  const [streaming, setStreaming] = React.useState(true)

  React.useEffect(() => {
    const chunks = REPLY.match(/\S+\s*/g) ?? []
    let i = 0
    const timer = setInterval(() => {
      i += 3
      setText(chunks.slice(0, i).join(""))
      if (i >= chunks.length) {
        clearInterval(timer)
        setStreaming(false)
      }
    }, 120)
    return () => clearInterval(timer)
  }, [])

  return (
    <StreamingAnswer
      text={text}
      streaming={streaming}
      actions={<button type="button" onClick={() => navigator.clipboard.writeText(text)}>Copy</button>}
    />
  )
}

Props

PropTypeDefaultDescription
textstring—Everything the model has sent so far; grow it as tokens arrive. Paragraphs (blank lines), - lists, **bold** and `code`.
streamingbooleanfalseMore is coming. Before the first word, a Thinking shimmer shows.
thinkingLabelstring"Thinking"The label before the first word.
pacenumber30Steady reveal pace in words per second; it speeds up when it falls behind.
actionsReactNode—Shown once the answer is complete: copy, regenerate, feedback.
onDone() => void—Called once the last word is on screen and streaming has stopped.
...propsHTMLAttributes<HTMLDivElement>—Any div attribute.

Accessibility

  • Screen readers hear whole sentences as they complete, through a polite live region, not every word.
  • aria-busy is true while the answer is still arriving.
  • With prefers-reduced-motion words appear without the fade, and an answer that is already complete shows at once.

Changelog

  1. v1.0.0Latest

    First release.

More in AI & Agents

All 4 in AI & Agents
  • AI & AgentsPro

    Approval Card

    The moment an AI agent asks before acting: what it wants to do, why, and exactly what will happen. Approve is held for a beat so it's never an accident; Deny is one press. Then it folds into a one-line record.

  • AI & AgentsPro

    Plan Timeline

    An AI agent's plan as it works through it: the current step pulses, a step waiting on you turns amber, finished steps tick and the line fills down to the next, so you see where it is at a glance.

  • AI & AgentsPro

    Tool Call

    One step an AI agent took: the tool, what it sent and what came back. Queued, running with a light sweeping its edge, done with a self-drawing tick and the time taken, or failed. Opens to show arguments and the result.