Pretext
JavaScript library for multiline text measurement and layout without DOM reflow
Visit chenglou.me ↗What is Pretext?
Pretext is a pure JavaScript/TypeScript library that measures and lays out multiline text without triggering expensive DOM operations like getBoundingClientRect or offsetHeight. It implements its own text measurement using the browser's font engine, supporting all languages and Unicode. The library can render to DOM, Canvas, or SVG.
Designed for developers building chat interfaces, editorial layouts, dynamic typography, and other text-heavy UIs, Pretext provides two main APIs: prepare() for one-time text normalization and measurement, and layout() for fast arithmetic-only calculations on resize. The project was developed with AI coding tools, as indicated by its repository configuration.
Momentum
Daily activity over the last 30 days: upvotes, unique visits, new GitHub stars and Hacker News points.
How do we know it's vibe coded?
vibetrend discovered Pretext automatically. Evidence: GitHub chenglou/pretext; repo has .cursor, AGENTS.md. View source.
Similar vibe-coded apps

Open-source control plane for orchestrating multiple AI coding agents

Open-source AI job search agent that runs locally in your CLI





94 specialist Blender skills for AI coding agents via MCP

All-in-one workspace unifying email, chat, docs, tasks, CRM, and agents