Pretext is a new JavaScript and TypeScript library from Cheng Lou - previously a React core developer - that crossed 7,000 GitHub stars in three days to get the entire tech world talking recently.

The demos that spread were visually striking: dragons parting text like water, fluid smoke rendered as ASCII, editorial layouts with animated orbs displacing text at 60fps.

Den Odell made the case that while there were amazing demos floating around - think dragons parting text like water, animating orbs moving around at 60fps and more - these are the least interesting aspects of Pretext.

What Pretext actually does is calculate the height of wrapped text without reading from the DOM. Normally, measuring text forces the browser to pause and recalculate layout — do that across hundreds of elements and performance degrades fast. Pretext uses the canvas measureText() API instead, which shares the same font engine but sits entirely outside the layout process. Simon Willison noted the library was stress-tested against a full render of The Great Gatsby across multiple browsers, and later extended to lengthy public domain documents in multiple languages, so the growth of the library has been incredible so far.

Nikola Balić wrote about the development process itself, saying how the use of Claude Code and Codex suggest some good emerging practices in AI-assisted engineering for larger scale projects.

We will be keep an eye on Pretext and we suggest you do too, and be sure to let us know what you think of it.