BaselAshraf81 / layout-sans
PublicPure TypeScript 2D layout engine powered by Pretext. Flex, Grid, Magazine multi-column, and Absolute layouts — with zero DOM and zero WASM bloat. Pretext measures text. LayoutSans positions everything. 100k variable-height boxes at 120 fps. Works everywhere: Browser, Node, Bun, Deno, Workers. The natural next primitive after Pretext.
LayoutSans is a tiny JavaScript library that computes precise positions for flexbox, grid, and text layouts without a browser or DOM.
How It Works
You hear about a tool that positions boxes, text, and grids super fast without needing a web browser, perfect for games, PDFs, or huge lists.
You easily include this lightweight tool in your JavaScript setup, ready to use anywhere JS runs.
You describe simple arrangements like rows of flexible boxes, columns of text, or magazine-style flows using everyday terms like width, gap, and flex.
With one quick calculation, you receive exact pixel locations (x, y, width, height) for every element, handling thousands smoothly.
You use those positions to paint on a canvas, build PDFs, or prepare server-side previews without any browser delays.
Your UI feels buttery smooth at massive scales, freeing you from browser limits for custom apps and renders.
Star Growth
Repurpose is a Pro feature
Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.
Unlock RepurposeSimilar repos coming soon.