StreamTextProps
Defined in: react/src/StreamText.tsx:18
Properties
Section titled “Properties”
optionalas?:ElementType
Defined in: react/src/StreamText.tsx:22
Element to render. Defaults to a span so it inherits typography.
className?
Section titled “className?”
optionalclassName?:string
Defined in: react/src/StreamText.tsx:23
field:
FieldState
Defined in: react/src/StreamText.tsx:20
The field, straight from useIsland().state.fields.*.
smooth?
Section titled “smooth?”
optionalsmooth?:boolean
Defined in: react/src/StreamText.tsx:52
Paced reveal for entrances — ON BY DEFAULT. LLM tokens arrive in
bursty batches — a whole clause at once, then nothing — which on screen
reads as jumpy paste-typing. The pacer drains the buffered text at a
capped per-frame rate so the entrance reads as fluent typing,
accelerating when the buffer runs deep so the canvas never falls far
behind the wire. Pass false to render wire text verbatim.
(Historically this was the opt-in switch; it is kept so the published API does not break, but pacing no longer needs it — most integrators never passed it, which left every real stream landing as a hard cut.)
Pure presentation, by contract:
- once a field enters a live typing run, nothing advances the canvas
faster than the pacer — a chunk burst extends the target, a mid-run
rewrite drains from the start, and
*-donecompletes the target so the drain finishes at the capped rate rather than teleporting; - text landing on a BLANK canvas — a replay flush, or the fallback when a hold runs out — types in at the same paced rate: every entrance is a typed entrance, whichever wire event staged it;
- text replacing VISIBLE text lands whole — on-screen copy is never retyped, so the single composed rewrite (and a terminal restore over a stranded fragment) snaps;
- state semantics never change;
- under
prefers-reduced-motion, and on a hidden page (where animation frames never fire), the full text renders immediately.
style?
Section titled “style?”
optionalstyle?:CSSProperties
Defined in: react/src/StreamText.tsx:24