smooth-stream-text weekly downloads statistics
By crmapache (2 listings) · npm · AI SDKs
Adaptive client-side pacing for streamed LLM text. Keep your Markdown renderer; the answer appears at an even rate. Zero-dependency headless core with React, Vue, Svelte and Web Component bindings and an optional fade-in reveal.
smooth-stream-text has 926 recorded weekly downloads on npm, a decrease of 9.6% over the past 30 days, ranking #2093 of 3,247 tracked listings.
About smooth-stream-text
smooth-stream-text
<p align="center"> <a href="https://smooth-stream-text.vercel.app"> <img src="https://raw.githubusercontent.com/crmapache/smooth-stream-text/main/docs/demo.gif" alt="The same markdown answer streamed twice, side by side, through the same renderer. On the left chunks land as they arrive and the text stutters; on the right it flows at an even rate with new words fading in." width="760" /> </a> </p> <p align="center"> <a href="https://smooth-stream-text.vercel.app"><b>Live playground</b></a> · <a href="https://smooth-stream-text.vercel.app/docs/"><b>Documentation</b></a> · <a href="https://github.com/crmapache/smooth-stream-text/tree/main/examples"><b>Examples</b></a> </p> <p align="center"> <a href="https://www.npmjs.com/package/smooth-stream-text"><img src="https://img.shields.io/npm/v/smooth-stream-text.svg" alt="npm version" /></a> <a href="https://bundlephobia.com/package/smooth-stream-text"><img src="https://img.shields.io/bundlephobia/minzip/smooth-stream-text" alt="minzipped size" /></a> <a href="./LICENSE"><img src="https://img.shields.io/npm/l/smooth-stream-text.svg" alt="MIT license" /></a> </p>Adaptive text-stream smoothing for AI chat interfaces. Keep your existing Markdown renderer and pace incoming text with a zero-dependency headless core. React, Vue, Svelte and Web Component integrations are included; a fade-in reveal is optional.
When a language model answers, the chunks arrive unevenly: one word, then twenty at once, then a pause while the server thinks. Rendering each chunk the moment it lands means the text stutters, and the eye reads the stutter before it reads the words.
smooth-stream-text sits between your transport and your renderer. You hand it the
text received so far and whether the answer is finished; it hands back a prefix that
grows at an even, adaptive rate, which you render exactly as before. It works with any
provider (OpenAI, Anthropic, Google, your own backend) because it only sees text.
- A real pacing controller. Not a fixed characters-per-second you tune per model - the rate follows from holding a constant distance behind the live text, so it adapts to whatever is feeding it.
- Headless first. Take the smoothed string and render it however you already do. The ready-made component is a convenience, not the only way in.
- Zero runtime dependencies. The core is pure logic and runs in Node, which is why its timing is tested without a browser and without waiting.
- Every framework. React, Vue, Svelte and a
<smooth-stream-text>Web Component - which also covers Angular, Solid, Qwik, Astro and plain HTML. Each framework is an optional peer dependency. - Careful about the text itself. The text grows a character at a time, or a
whole word at a time if you prefer - in Chinese, Japanese and Thai too - and
never stops inside a
**, a half-written link or an emoji, so a markdown renderer downstream never flashes broken syntax.
It fits when text arrives in bursts and you want it to read as a steady flow, you already have a renderer (react-markdown, Streamdown, marked, your own), and history must appear at once while only new answers are paced.
It does not fit when you only render static Markdown, need transport features
(retries, reconnects), want a CSS typing effect for a heading, or already pace text
in another layer such as the AI SDK's smoothStream() and are happy with it: two
layers add their delays. The core runs anywhere JavaScript runs, but only the web
bindings are built and tested. Choosing an approach
compares the alternatives.
Install
npm install smooth-stream-text
Full documentation, with a guide per framework and runnable examples:
smooth-stream-text.vercel.app/docs.
For tools and coding assistants, llms.txt
lists every page as plain Markdown, and the package ships
INTEGRATION.md, a short guide readable offline in
node_modules/smooth-stream-text/. An optional
Agent Skill for coding agents installs with
npx skills add crmapache/smooth-stream-text.
Quick start - headless (the main path)
Most chat UIs parse markdown themselves and render it with their own components. Those only need the smoothed string:
import { useSmoothText } from 'smooth-stream-text/react'
function Answer({ answer, streaming }: { answer: string; streaming: boolean }) {
const { text } = useSmoothText(answer, { done: !streaming })
// `text` is a prefix of `answer` that grows evenly. Parse and render it exactly
// as you did before.
return <Markdown>{text}</Markdown>
}
That is the whole integration. Feed it your accumulated answer, render what comes
back. useSmoothText re-renders only when the visible text or the phase changes,
at most once per animation frame while text appears. That can be more often than
chunks arrive, so if your Markdown rendering is expensive, see the
benchmarks. useSmoothStream
takes the same arguments and returns the full state as well - the backlog, the
current rate, the source - for debugging and charts.
One hook serves a whole conversation. A message that is already done when it
first arrives is history and appears at once. A different message starts over.
done closes whichever answer is current, including when its last chunk lands
after done was already set.
If your transport hands you deltas and you would rather not accumulate them:
import { useSmoothStreamController } from 'smooth-stream-text/react'
const { text, push, end } = useSmoothStreamController()
// push(delta) on each chunk, end() when the stream closes
Recipes…
Description from the npm listing.
- streaming-text
- smooth-streaming
- stream-text
- llm
- llm-ui
- ai-chat-ui
- ai-ui
- typewriter
- text-reveal
- streaming-markdown
- token-streaming
- headless
- react
- vue
- svelte
- web-component
- animation
- ai-sdk
- vercel-ai-sdk
- react-hooks
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (170)Similar npm AI SDKs plugins
All 20 smooth-stream-text alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/smooth-stream-text. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.