Skip to content

ShipItAndPray/awesome-pretext

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

awesome-pretext

Live site Upstream

A curated list of projects, packages, demos, and experiments built with Pretext, Cheng Lou's text layout engine for measuring and laying out multiline text without DOM reflow.

This list is meant to be useful to the broader Pretext community:

  • official resources first
  • ecosystem packages with live demos
  • selected community experiments and integrations

Live Site

Why Pretext matters

Pretext lets you answer layout questions before paint:

  • measure multiline text without getBoundingClientRect()
  • predict height for virtualization and zero-CLS UI
  • drive canvas, SVG, WebGL, and server-side rendering paths
  • build shrinkwrapped, width-aware text interfaces in plain arithmetic

Official Pretext Resources

Flagship Ecosystem Packages

These are the strongest package-shaped projects in the current ecosystem.

Project What it does Links
pretext-react React hooks and UI primitives for stable text sizing, bubbles, streaming text, and virtualization. demo
pretext-chat Chat UI components with precomputed message sizing and streaming-friendly layout. demo
pretext-terminal Canvas-first terminal and log UI for large scrollback and ANSI-rich output. demo
pretext-editor Canvas text editor using Pretext for line measurement instead of DOM text nodes. demo
pretext-pdf PDF generation with correct wrapping and pagination powered by Pretext + pdf-lib. demo

Ecosystem Catalog

All demo links below were verified live on March 30, 2026.

Foundations and UI Primitives

Project Description Demo
pretext-react React hooks and components for stable text measurement and streaming layout. live
pretext-accordion Zero-CLS accordion with predictive height measurement. live
pretext-forms Auto-sizing form controls without DOM reflow. live
pretext-tooltip Tooltips that know their size before render. live
pretext-truncate Multiline truncation without content flash. live
pretext-ssr SSR-first font loading and fallback prediction for zero layout shift. live
pretext-typewriter Streaming text animation with stable final-height measurement. live
pretext-masonry Masonry grid layout driven by predicted card heights. live
pretext-overflow-menu Nav bar that collapses items into "+N more" dropdown correctly on frame 1. live
pretext-animate Physics-based text animations with zero layout reflows. 120fps on mid-range devices. live

Chat, Terminal, and Log Interfaces

Project Description Demo
pretext-chat React chat surfaces for message streaming and virtualized history. live
pretext-terminal Canvas terminal for large scrollback and ANSI rendering. live
pretext-logviewer Virtualized log viewer for very large ANSI-heavy outputs. live
pretext-repl REPL/notebook UI where output cells expand without shifting other cells. live

Editors, Documents, and Reading Systems

Project Description Demo
pretext-editor Canvas editor with hidden textarea input and Pretext line layout. live
pretext-blocks Notion-style block editor virtualization. live
pretext-markdown Streaming markdown rendering with stable block heights. live
pretext-diff Large side-by-side diff viewer with virtualized rendering. live
pretext-pdf PDF generation with wrapped text and pagination. live
pretext-docgen JS-first document generation without a headless browser. live
pretext-epub EPUB pagination with direct page access. live
pretext-slides Markdown-to-canvas presentation system. live
pretext-captions Subtitle editor and renderer with WCAG-aware layout. live
pretext-diff-navigator Side-by-side diff viewer with drift-free synchronized scrolling. live

Graphics, Media, and Canvas Rendering

Project Description Demo
pretext-canvas Canvas and WebGL text rendering helpers powered by Pretext. live
pretext-comic Speech bubbles and shape-aware text fitting for comics. live
pretext-og Open Graph image generation that fixes wrapping issues in Satori-style flows. live
pretext-tts-highlight Karaoke-style word highlighting synced to audio or TTS. live
pretext-webxr 3D and XR-oriented text layout surfaces. live
pretext-sparkline Inline sparklines with collision-free value labels computed before render. live
pretext-word-cloud Deterministic word cloud layout. 500x faster than d3-cloud. live
pretext-map-labels Collision-free label placement for 2D maps and diagrams. live
pretext-gantt Zero-flicker Gantt chart with labels measured and placed correctly on frame 1. live
pretext-infinite-canvas Figma/Miro-style infinite canvas with correct text wrapping at any zoom level. live
pretext-code-minimap VS Code-style code minimap for the browser. Pixel-accurate, Canvas-rendered. live

Tables, Data, and Platform Targets

Project Description Demo
pretext-table Virtualized data table with Pretext-powered column sizing. live
pretext-rn React Native bridge for text measurement and list layout. live

Testing, DevTools, and CI

Project Description Demo
pretext-storybook Stress-test UI components with dynamic text. Flags overflow before it ships. live
pretext-devtools Overlay Pretext text measurements on any webpage. See predicted vs actual dimensions. live
pretext-a11y WCAG text overflow audit in CI. No browser needed. live
pretext-i18n Catch i18n text overflow at build time. No browser needed. live
pretext-overflow-monitor Detect text overflow in CI before any browser render. Zero DOM, pure arithmetic. live

Selected Community Projects

This section exists so the list is useful beyond one GitHub account.

Project Why it is interesting
pinch-type Highest-visibility public experiment built on Pretext right now.
pretext-playground Strong creative coding showcase with multiple text-driven scenes.
react-pretext Earlier React wrapper for Pretext-style measurement workflows.
pretext-rich Inline rich text engine on top of Pretext.
textmash Experimental text-wrapping demo around other text chunks.
pretext-php Interesting port that shows the design can travel outside JS.

What makes a good Pretext project

  • it solves a real layout problem before paint
  • it demonstrates something hard to do with plain DOM measurement
  • it ships a live demo, not just a repo
  • it explains why Pretext is the enabling primitive

Add a project

Open a PR with:

  • repo link
  • one-line description
  • live demo link if available
  • what Pretext unlocks in that project

Attribution

This is an independent ecosystem list. Pretext itself is authored and maintained by Cheng Lou, and the canonical upstream project is chenglou/pretext.

About

Curated ecosystem list for projects built on Pretext, with live demos and community examples.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages