Pretext - Text measurement that never touches the DOM.
pretextjs.dev · 1,578 words · saved by 2 readers
Pretext is a high-performance, pure JavaScript/TypeScript layout library for text rendering. Zero dependencies, framework-agnostic, blazing fast.
Pure JS · Zero DOM reads · TypeScript-first Pretext Text measurement that never touches the DOM. Pretext measures and positions multiline text entirely through arithmetic — no getBoundingClientRect , no reflow, no thrashing. Fast on first call. Instant on every call after. Open Playground → Browse demos Editorial Engine Drag orbs · Click to pause · Zero DOM reads Load live demo ▶ Pretext Breaker — Play the Game A Breakout-style arcade game where every pixel is rendered with text. Smash word-bricks and watch text reflow in real time — powered by Pretext.js. Play → 14k + GitHub stars for Pretext
saved by
related reading
- GitHub - chenglou/pretext: Fast, accurate & comprehensive text measurement & layoutgithub.com
- Pretext Demoschenglou.me
- Motion (prev Framer Motion): JavaScript & React animation librarymotion.dev
- Anime.js | JavaScript Animation Engineanimejs.com
- AI Elementselements.ai-sdk.dev
- An Introduction to the Browser Rendering Pipelinewebperf.tips
- The Web Animation Performance Tier List | Motion Magazinemotion.dev
- Text Rendering Hates You - Faultlorefaultlore.com
- Shadersshaders.com
- Peritext: A CRDT for Rich-Text Collaborationinkandswitch.com
- Zed — Your last next editorzed.dev
- Cheng Lou on X: "My dear front-end developers (and anyone who’s interested in the future of interfaces): I have crawled through depths of hell to bring you, for the foreseeable years, one of the more important foundational pieces of UI engineering (if not in implementation then certainly at https://t.co/BKnwCDIp75" / Xx.com