ViewSpec

ViewSpec
Universal UI from semantic data.
Describe what your data means. The compiler figures out how it looks. Every pixel has a birth certificate.

Text rendered with Pretext canvas surfaces

pip install viewspec
from viewspec import ViewSpecBuilder, compile
from viewspec.emitters.html_tailwind import HtmlTailwindEmitter

builder = ViewSpecBuilder("invoice")
table = builder.add_table("items", region="main")
table.add_row(label="Design System Audit", value="$4,200")
table.add_row(label="Component Library", value="$8,500")
table.add_row(label="API Integration", value="$3,100")

ast = compile(builder.build_bundle())
HtmlTailwindEmitter().emit(ast, "output/")

# That's it. Full UI. Full provenance. No CSS.
✓ Exactly-once provenance ✓ Semantic grouping ✓ Strict ordering
Compilation
3ms deterministic — no LLM, no GPU
Provenance
Every pixel traces to its source data
Invariants
Exactly-once · Semantic grouping · Strict order

This section is ViewSpec compiler output. View raw →

See it work.
01
Same Data, Three Motifs
One dataset, three visual structures. Change one parameter.
02
Provenance Inspector
Hover any element. Trace DOM → IR → binding → address → raw data.
03
Live Builder
Browse ViewSpec JSON, IR tree, and rendered output. Always in sync.
04
The Invariants
Watch the compiler enforce — and refuse — each guarantee.
05
15 Lines → Full UI
An invoice table builds itself from 15 lines of Python.
06
Style Derivation
Same structure, different feel. Toggle presets — the compiler separates routing from style.
Describe
Semantic substrate + ViewSpec. What the data means, not how it looks.
Compile
Deterministic routing with provenance guarantees. 3ms. No LLM.
Render
Pluggable emitters. HTML today. Canvas tomorrow. Your renderer next.

Pipeline compiled from semantic data.