MALDA™ Reference Manual

The AI-First Programming Language - Version 1.0.11

23. Web UI Overview

MALDA supports more than one way to build user interfaces. The models below share HTTP and routing concepts but target different runtimes and delivery styles. Start here before diving into a specific chapter. Prefer one model per surface (IDE UI1002 when a file mixes @PAGE/@AIPAGE with ui.mount/ui.render).

Full-stack context: For how UI, API, database, and agents fit together, see 29. Full-Stack Development with MALDA. For server-driven UI runtime/host internals (patch protocol, UIHost), see docs/ui-framework.md.

23.1 Choose your UI model

Model Best for Key constructs Chapter
HTML fragment components Form and list pages that return HTML strings, with targeted fragment updates and optional SSE component, @ACTION, @LIVE, componentFragment, componentState* 24. Web UI Server Components (§ 24.2)
Server-driven ui.* trees Incremental patch UI hosted by UIHost; controls are node trees, not HTML strings ui.button(props, …), ui.mount / ui.render, ui.state 24. Web UI Server Components (§ 24.3)
HttpServer pages Route-first apps that return full HTML documents, AI-generated pages, or classic server-rendered sites HttpServer, @PAGE, @AIPAGE, HTMLCache, generateUI() 25. HttpServer & HTML UI Generation
Browser JavaScript UI that runs in the browser from MALDA transpiled to JavaScript (games, DOM apps, hybrid frontends) dom.*, template mode, @client(), canvas/game APIs 26. Browser JavaScript UI Backend

23.2 Decision guide

Pick HTML fragment components when…

Pick server-driven ui.* trees when…

Pick HttpServer / @PAGE when…

Pick browser JavaScript when…

23.3 How the models relate

                    ┌─────────────────────────────────────┐
                    │         MALDA Web UI choices          │
                    └─────────────────────────────────────┘
                                      │
     ┌───────────────┬────────────────┼────────────────┬────────────────┐
     ▼               ▼                ▼                ▼
 HTML fragments   ui.* trees     HttpServer / @PAGE   Browser JS
 (component +     (mount/render  (full pages +        (transpile +
  ACTION + LIVE)   + UIHost)      AI HTML)             dom.* / canvas)
     │               │                │                │
     └───────────────┴────────────────┴────────────────┘
                                      │
                              HTTP / REST API layer
                         (see REST API + REST Web Client)

You can combine models in one product when boundaries are explicit: for example, @PAGE for marketing routes, a ui.* app shell, and a browser JS bundle for an interactive widget. See 27. REST API Server for JSON endpoints that any UI model can call.

23.4 Runtime boundary reminder

See 2. Tools & Tooling (Runtime modes at a glance) for interpreter vs transpile vs JavaScript trade-offs.

See Also