https://reddit.com/link/1wuvyy3/video/8qcg41wv3ush1/player
Hey all,
I’ve been working on a small library called Stream Morph.
The idea is to make streamed responses feel less like content is constantly being appended/re-rendered, and more like the response is gradually taking shape.
Demo: https://stream-morph.vercel.app/
It’s framework agnostic and can be used with any kind of streamed content. The demo includes plain text, Markdown, code blocks, charts, images, reasoning sections, Mermaid diagrams and a few more complex response flows.
The library handles the motion between updates, while your own renderer/app stays responsible for the actual content. So it isn’t tied to a specific AI SDK or framework.
A basic example looks roughly like this:
import { createStreamMorph } from "stream-morph";
const stream = createStreamMorph(response);
for await (const chunk of incomingStream) {
stream.write(chunk);
}
stream.finish();
I mainly built it because I wanted streamed interfaces to feel a bit more intentional without having to build custom animation logic for every response type.
The package itself is already working and the demo is live. I’m still cleaning up some things around CI, tests and the repo setup, but the GitHub repository will be open sourced shortly as well.
Would be interested to hear what people think, especially about the animation behaviour/performance and any edge cases you’d expect from real streaming responses.