npm install textura

Yoga alone vs Textura

Yoga computes flexbox layout but cannot measure text — it needs fixed heights or guesses. Textura wires in Pretext's canvas-based text measurement so every node gets exact geometry. No DOM. No reflow.

440px
14px
Yoga Alone (estimated heights) text blind
Textura (measured text) pixel-accurate
0
Issues found
0
Issues fixed
Analysis time
0
Actions taken
Per-step layout
Steps / sec (max)
vs Browser (~80ms)
0
Rooms generated
Layout time
0
Wrong heights (Yoga)
0px
Total height drift
0
UIs generated
Layouts / sec
Avg layout time
Nodes per UI
0
Tokens streamed
Layout per token
0
Yoga layout shifts
Progress
Items pre-computed
Computation time
Estimated item drift
Total height error
FPS (Textura)
Animated width
Frame times
Yoga overlaps / clips
Yoga height error
Textura resize (cached)
DOM measurement

What you're seeing

Get Started

// Install
npm install textura

// Use
import { init, computeLayout } from 'textura'

await init()  // load Yoga WASM (once)

const tree = {
  width: 400, flexDirection: 'column', padding: 16, gap: 8,
  children: [
    { text: 'Hello Textura', font: '700 24px Inter', lineHeight: 32 },
    { text: 'Pixel-perfect layout without the DOM.', font: '16px Inter', lineHeight: 24 },
  ],
}

const layout = computeLayout(tree, { width: 400 })
// → { x, y, width, height, children: [{ x, y, width, height, text }, ...] }

MCP Server — AI Layout Analysis

Give your AI coding agent layout vision. Detect text overflow, element overlap, small touch targets, and auto-fix issues — works with any framework.

# Claude Code — one command:
claude mcp add textura npx @razroo/textura-mcp

# Or add to .mcp.json / Codex / Cursor / VS Code:
{
  "mcpServers": {
    "textura": {
      "command": "npx",
      "args": ["-y", "@razroo/textura-mcp"]
    }
  }
}

Tools: compute_layout · analyze_layout · validate_responsive · fix_layout