Client Portal See your site rebuilt
Guides / What is Pretext? The text layout library, its creator, and where it stands
Research

What is Pretext? The text layout library, its creator, and where it stands

Pretext is an open-source JavaScript library by Cheng Lou that measures and lays out multiline text without touching the DOM. Here is what it does, who built it, where it was published, how the community took it up, and what it is not. Including how it relates to our own website product, and how it does not.

9 min read · updated September 7, 2026 · every claim links to its source

What Think Bright Sites is, and is not

Our website product is called Think Bright Sites. For a few months during development it carried the working name "preText," chosen as a nod to the library and the idea behind it: measure first, then decide. We retired that name before launch, for the reason this article makes obvious. A product should not share a name with a library it does not run, and Cheng Lou's work should not be confused with ours. We are not affiliated with him, and he has not endorsed us.

Where we use the library: inside the row editor that our team and clients use to change a page, so text edits reflow instantly without a browser layout hit. Where we plan to use it: the preview thumbnails in the onboarding wizard, a pre-flight check that a headline will not wrap to four lines on a phone before we spend a screenshot on it, and the text-on-image work in the social asset builder.

Where we do not use it: the pages you receive. A Think Bright page is plain HTML. The browser lays out the text, and nothing runs in the page except the small script that makes forms work. That is deliberate. The library exists to avoid the browser's layout pass when you are drawing text yourself. When the browser is drawing the text, the right amount of JavaScript is none.

So the honest sentence is this. Pretext is a text measurement engine that a lot of people are excited about, for good reason. Think Bright Sites is a way to rebuild the website you already have, match first, and keep it as a file you own. One informed the other. They are not the same thing.

Sources

  1. Pretext repository and README (GitHub) github.com/chenglou/pretext
  2. @chenglou/pretext on npm www.npmjs.com/package/@chenglou/pretext
  3. Official demos chenglou.me/pretext/
  4. Author announcement on X, March 27, 2026 twitter.com/_chenglou/status/2037713766205608234
  5. Hacker News discussion, 397 points news.ycombinator.com/item?id=47556290
  6. Hacker News: "The future of text layout is not CSS" news.ycombinator.com/item?id=47551254
  7. Simon Willison on Pretext simonwillison.net/2026/Mar/29/pretext/
  8. InfoQ coverage www.infoq.com/news/2026/04/pretext-js-120fps-text-layout/
  9. VentureBeat coverage venturebeat.com/technology/midjourney-engineer-debuts-new-vibe-coded-open-source-standard-pretext-to
  10. Den Odell, "You are looking at the wrong Pretext demo" dev.to/denodell/youre-looking-at-the-wrong-pretext-demo-4960
  11. HackerNoon coverage hackernoon.com/pretext-does-what-css-cant-measuring-text-before-the-dom-even-exists
  12. PC Gamer coverage www.pcgamer.com/software/browsers/i-have-crawled-through-depths-of-hell-one-coders-suffering-is-a-potential-joy-to-every-web-user-as-their-project-could-make-sluggish-browsers-a-thing-of-the-past/
  13. 36Kr coverage eu.36kr.com/en/p/3745083757068551
  14. Cloudmagazin coverage www.cloudmagazin.com/en/2026/03/29/pretext-does-a-javascript-library-solve-the-browsers-30-year-old-text-layout-pro/
  15. Fireship video www.youtube.com/watch?v=vd14EElCRvs
  16. awesome-pretext, curated ports and projects github.com/bluedusk/awesome-pretext
  17. swift-pretextkit github.com/tornikegomareli/swift-pretextkit
  18. PretextSharp github.com/wieslawsoltes/PretextSharp
  19. layout-sans github.com/BaselAshraf81/layout-sans
  20. Author research notes (RESEARCH.md) raw.githubusercontent.com/chenglou/pretext/main/RESEARCH.md
  21. Author thoughts (thoughts.md) raw.githubusercontent.com/chenglou/pretext/main/thoughts.md
  22. Predecessor: text-layout (archived) github.com/chenglou/text-layout
  23. Cheng Lou on GitHub github.com/chenglou
  24. react-motion github.com/chenglou/react-motion
  25. Reactiflux Q&A with Cheng Lou, 2017 www.reactiflux.com/transcripts/cheng-lou
  26. "On the Spectrum of Abstraction," React Europe 2016 www.youtube.com/watch?v=mVVNJKv9esE
  27. PreTeXt authoring system (unrelated) pretextbook.org/

See the match before you decide.

Paste your URL. We rebuild it, show you the match, and measure the speed. No template. No blank page. Human review from start to finish.

See your site rebuilt →Call (832) 422-7266