pretext.cool - Pretext — 15KB Zero-Dependency Text Layout Engine by Cheng Lou | Demos, Library, API

Description: Pretext is Cheng Lou's 15KB, zero-dependency TypeScript text layout library — 500x faster than DOM measurement, 12+ writing systems, framework-agnostic. Browse 20 live demos, the API reference, React / TypeScript guides and FAQ.

pretext (3) pretext library (1) chenglou pretext (1) cheng lou pretext (1) pretext github (1) pretext npm (1)

Example domain paragraphs

Playground API Library Blog FAQ EN 中 Star 29.5k Demos → Playground → API → Library → Blog → FAQ → EN 中文 GitHub ↗ Community demo hub · v2 · 20 live demos Pretext, played. DOM-free text at 500× speed. 20 interactive demos built on @chenglou/pretext — the 15KB zero-dependency TypeScript library by Cheng Lou (React core, ReasonML, Midjourney). Reflows, games, ASCII art, multi-script editorial layouts. Drag the panel on the right to see it work in real time.

Community-maintained, not an official site. The library lives at github.com/chenglou/pretext · official demos at chenglou.me/pretext .

Read the API ★ 29.5k stars ⚡ 500× faster 📦 15 KB · 0 deps 🌏 12+ writing systems live.reflow.ts no DOM measurements The quick brown fox jumps over the lazy 狗. Pretext re-flows this paragraph using pure arithmetic — no DOM reads, no reflow. 字符在毫秒内重新排列。 ⇔ Container 320px Lines 3 Layout() 0. 001 ms drag the handle · or focus + ← →

Links to pretext.cool (1)