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
- 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
- AI Elementselements.ai-sdk.dev
- Subframe – The AI design tool built for codesubframe.com
- UI Skills for Design Engineers | UI Skillsui-skills.com
- ui.sh — Agent skills for interface buildersui.sh
- DESIGN.md Examples for AI Agents | Refero Stylesstyles.refero.design
- Agentationagentation.dev
- Motion (prev Framer Motion): JavaScript & React animation librarymotion.dev
- Impeccable: The missing upgrade to Anthropic's impeccable skillimpeccable.style
- Craftrauno.me