Power-User Systems

Stream

An AI response surface that streams the way live chat UIs stream — a shimmer while the model thinks, tokens arriving on an irregular clock and blurring into place, a generation caret riding the last word, and stop and regenerate controls that actually interrupt. The cadence rides the animation clock rather than timer chains, so pausing the bench freezes generation mid-word. Only the trailing window of tokens are live animated elements — everything older folds into one static text node, so a long answer never accumulates a thousand springs — and an invisible ghost of the full answer holds the final height, so neither the thinking-to-streaming swap nor the stream itself ever moves layout.

Install

bun add motion lucide-react clsx tailwind-merge

Then copy 3 files into your project:

  • components/registry/stream/stream.tsx
  • hooks/use-animation-loop.ts
  • lib/utils.ts

Props

PropTypeDefaultDescription
tokensPerSecondnumber18Average emission rate.
jitternumber0.35Cadence irregularity — bursts and occasional stalls that make it read as a live model rather than a metronome.
chunking"word" | "character""word"Emission granularity. Words read like a model; characters read like a terminal.
blurAmountnumber6Blur each token arrives from.
thinkingMsnumber1200Shimmer skeleton phase before the first token.
caret"bar" | "block" | "none""bar"Generation caret riding the last token.
caretColorstring (hex)"#a78bfa"Caret tint.
autoReplaybooleantrueRegenerate automatically after settling, so the demo loops hands-free.

What It Demonstrates

Typewriter
Text appearing one character at a time, as if being typed.
Skeleton / Shimmer
A placeholder with a moving sheen shown while content loads.
Blur
A blur filter used to soften an element or mask tiny imperfections.
Stagger
Animate several items one after another with a small delay between each, creating a cascade.

Related Components

Appears In