Skip to content

Text Streaming

Free

Text that grows as it streams in, such as an AI answer: only the new end fades in, and nothing else moves.

  • Motion
  • React 19
  • Tailwind CSS 4

Added Nov 14, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

Pass the whole answer so far. Only the new end fades in.

The sample also uses Card. One command adds them with this item:

assistant-answer.tsx

TextStreaming

<span>
PropTypeDefaultDescription
childrenRequiredstring—The text so far. Pass the whole text on each update ("Hel", then "Hello wor"): only the new end fades in. A text that does not start with the last one (a new answer, an edit) shows at once, with no motion.
animateInitialbooleanfalseFade in the text of the first render too. Default false: a message that is already there when the page loads (a chat history) shows at once. With it on, a text in the server HTML stays hidden until hydration starts its fade, and stays hidden with no JavaScript.
...props<span> attributes—Every other attribute goes to the <span>, with a ref.
  • Pass the whole text so far on each update; only the new end fades in.
  • Put it inside the paragraph of a chat message: it is inline text, so the paragraph sets the size, the line height, and the wrap.
  • Keep animateInitial off for a message that is there when the page loads, so a chat history shows at once.
  • Set aria-busy on the message while it streams, and remove it when the stream ends.
  • For text that types in letter by letter with a caret, at its own pace, use Text Typewriter.
  • For text that resolves from random letters, use Text Scramble.
New text
reveal · 400ms · each new end fades in from 0 opacity and a 0.25em blur; the text before it does not change
Reset
none · a text that does not start with the last one shows at once
  1. AddedText Streaming.
Open the release