Every AI chat app has the same bug — scrollbar jitter when streaming tokens. ZeroJitter is a React component that renders streaming LLM text on instead of the DOM. The result: → 0 layout reflows (DOM causes 1 per token) → 60fps locked (DOM drops to 45-58fps) → <1ms layout time (DOM: 0.3-2ms) → Zero dependencies → Full accessibility (aria-live mirror) → International text (CJK, BiDi, Thai, emoji) Text measurement happens in a Web Worker. The main thread just paints pixels.
No reviews yetBe the first to leave a review for ZeroJitter
Maker
📌
I built a React component that renders streaming LLM text on instead of the DOM, eliminating layout reflows entirely.
The problem: every token from an LLM stream triggers a DOM mutation → style recalculation → layout reflow → paint → composite cycle. At 50+ tokens/second, this causes visible scrollbar jitter and dropped frames.
The solution: measure text in a Web Worker (via Intl.Segmenter + CanvasRenderingContext2D.measureText), then paint with fillText(). Zero DOM involvement. The main thread just pushes pixels.
Results: 0 reflows (vs 1 per token), locked 60fps, <1ms layout time. Full accessibility via aria-live mirror. Supports CJK, BiDi, Thai, emoji.
Live demo (side-by-side DOM vs canvas): https://altrusian.com/zero-jitter
npm: npm install zero-jitter
GitHub: https://github.com/jvoltci/zero-...
The text layout engine is vendored from @chenglou's pretext library (MIT). Zero runtime dependencies.