Scott Swarthout

Relo UI

A server-driven UI runtime that renders the same screen on iOS, Android, and the web.

Experimental

Use the arrow keys to move a light. Press Escape to return the lights to their starting positions.

In Relo UI, a server sends a document describing a screen’s layout and behavior. The same document can drive UIKit controls on iOS, Views on Android, or DOM elements in a browser.

Rendering a screen

  1. Screen documentDefines the elements and their behavior.
  2. Shared Rust engineValidates the document, evaluates expressions, and computes layout and motion.
  3. Platform renderersUIKit on iOS, Views on Android, and the DOM on the web.

The Rust engine compiles to WebAssembly for use in browsers, including React apps. The repository also includes examples of Relo screens embedded in Compose and SwiftUI.

The playground pairs an editable screen document with a live preview.