Home Docs Download About Contact
Download

PrismX UI — introduction

Declarative native UI that compiles to the platform's real widgets.

PrismX UI Updated 2026-08-01 Edit this page

PrismX is Prism’s UI language. A .prismx file describes an interface declaratively; the compiler turns it into calls against the platform’s real widget toolkit. On Windows that is WinUI, on macOS AppKit, on Linux GTK, and on iOS and Android the native frameworks — the UI you ship is the UI the platform draws. No webview, no HTML, no JavaScript bridge.

A first view

class Counter {
    width = 360
    height = 240

    Column mainCol = {
        align = "center"

        Label countLbl = {
            text = "Clicked 0 times"
        }

        Row btnRow = {
            gap = 12
            Button incBtn = {
                text = "Increment"
                onPress: {
                    Signal onIncrement()
                }
            }
            Button resetBtn = {
                text = "Reset"
                onPress: {
                    Signal onReset()
                }
            }
        }
    }
}

The window attributes become class properties, and Column, Row, Label and Button map to native widgets. Anything else is a class you define — a class is the reusable unit.

Why markup?

Markup and logic are separated because they change at different rates. Layout churn does not touch your signal wiring, and the formatter, linter and language server all understand the markup structure directly. The result is a file you can read top to bottom.

Rendering rules

  • Updates are surgical — a handler changes exactly the widget it targets via setText(id, …).
  • Widgets are native objects. If the platform exposes a control, PrismX exposes it.
  • Accessibility is structural, not bolted on: labels and tooltips are widget properties.
Button sendBtn = {
    text = "Send"
    tooltip = "Sends the current form"
    onPress: {
        Signal submit()
    }
}

Adding logic

Markup references functions and signals from Prism code. The two live together:

// counter.prism
pub fn submit() {
    println("submit() called")
}

PrismX does not need its own runtime — it reuses the same signals and handlers as the rest of the language.

Note: PrismX targets are in active development. Desktop targets ship first; iOS and Android are next on the roadmap.

Continue with Components.