What is Pax?

Pax is a language-first GUI framework for Rust. A Pax application combines declarative .pax templates, reactive properties and PAXEL expressions, Rust application logic, and a portable runtime. You can build for web browsers, macOS, iOS, and iPadOS, with alpha support for Android, Windows, and Linux.

Pax combines application structure with direct control over layout, vector drawing, composition, and motion. Its language keeps those visual choices close to the state and interactions that drive them.

If you already know you want to try it, go directly to Getting Started. That chapter stands on its own.

A language built for interfaces

A Pax component usually has two source layers: a Rust type and a .pax template. The template declares the component's interface tree, layout, styling, bindings, control flow, event routing, responsive choices, and motion. The Rust type exposes application state and owns handlers, data access, platform integration, and other imperative work.

Inside a template, PAXEL expressions derive values from reactive properties. They can combine values, choose between alternatives, perform unit arithmetic, and feed the result into content, layout, styling, or animation. PAXEL is side-effect-free: it describes relationships between values rather than a sequence of commands.

For example, a Rust handler can load data and update a property, while a template expression derives the label or color to display. Read the template and Rust file together to understand a component's behavior.

Try it: Living Quilt

Living Quilt is an expressive showcase, available through pax-cli create my-quilt --example=living-quilt. Move the pointer to shift its light, click or tap the quilt to send a wave of color through the tiles, and click the Pax card to replay its entrance. The scene combines responsive components, Rust-driven motion, lighting, and feathered alpha masks. The GPU renderer adds lighting. The CPU renderer supports the color-reveal masks and draws the tiles without lighting.

The source tabs show how those parts fit together. For a smaller first project, pax-cli create my-app starts with Pax Logo: a logo, slider, and buttons. Getting Started walks through editing that simpler scene.

The Pax authoring loop

The central loop has four beats:

  1. A .pax template declares the interface and binds an event.
  2. PAXEL expressions derive visible values from reactive properties.
  3. An interaction invokes a Rust handler.
  4. The handler updates a property, and Pax updates the parts of the interface that depend on it.
 .pax template ──renders──> interface ──event──> Rust handler
       ▲                                           │
       │                                           │ sets
       └── PAXEL derives visible values ◀── reactive properties

When the property changes, Pax invalidates the values that depend on it and reevaluates them when needed. Like a spreadsheet, changing an input updates the formulas that use it. Rust can also construct computed properties and subscriptions directly when an application needs a relationship or effect beyond the template.

The later chapters separate these responsibilities in more detail: Templates & UI Structure covers the declarative tree, Data Binding & Expressions covers PAXEL, State & Properties covers the reactive graph, and Events & Rust covers the imperative side of the loop.

One interface model, multiple native targets

The same templates, properties, and Rust logic can be used across targets. Each target has a platform adapter, called a chassis, that connects the runtime to rendering, input, native elements, and platform services.

Application targetsCurrent scope
Web browsersRuns through WebAssembly, with GPU and CPU rendering paths.
macOS, iOS, and iPadOSNative Apple applications with GPU rendering.
Android, Windows, and LinuxAlpha native hosts with target-specific requirements and limits.

Web and desktop development are supported from macOS, Debian/Ubuntu Linux, and Windows; Apple targets require a suitable macOS and Xcode environment. Getting Started covers workstation setup. Targets, Build & Deployment lists the requirements and limitations for each target.

Web builds select WebGPU when browser policy permits and initialization succeeds, with Vello CPU as the software fallback. Effects such as lighting and GPU shaders need fallback choices when the CPU renderer is selected. Compositing & Effects explains how to make those choices.

Pax also integrates native elements where platform behavior matters. Native text, form controls, and scrolling can share a scene and coordinate space with rendered shapes, images, paths, and motion. Native elements have their own clipping, masking, and styling limits, described in User Interface Controls and Compositing & Effects.

How Pax Runs explains how the compiler, runtime, and chassis bring these parts to the screen.

Why choose Pax?

The language is designed for ambitious user interfaces. Structure, reactive formulas, units, event bindings, conditional settings, and declarative motion live close to the elements they affect. Rust handles application logic and integration with existing libraries and services.

Components, state, routing, and responsive layout can share a scene with paths, gradients, masks, native controls, and animation. You can build a form, an interactive visualization, or a richly animated interface using the same authoring model.

The developer tools support template hot reload, scene inspection, screenshots, and repeatable event-driven checks. These make it possible to test changes in the running application during development.

Current scope and maturity

Pax is ready for building. It remains pre-1.0, so APIs can evolve, some areas are still limited, and feature or backend maturity can vary by target. Evaluate the capabilities your application needs on its intended devices and rendering backends before shipping.

Rust is the current application language. Native text and controls supply platform editing and selection. See Accessibility for current keyboard behavior, image-alternative limitations and reader annotations.

The framework, language, compiler, runtime, CLI, hot reload, source mapping, inspection, screenshots, and event-driving infrastructure ship as open source in the Pax repository.

Start building

Install the CLI, create a project, and run it.

If you prefer to explore before installing, browse the repository examples and return to the authoring loop above when you want to understand how their templates and Rust code fit together.