Available

amalgame-ui-web

Webview-based: WebView2 / WKWebView / WebKitGTK + JS ↔ AM IPC.

amc package add ui-web GitHub ↗ ← Back to the ecosystem

Overview

Desktop UI toolkit based on the system's native webview (WebView2 on Windows, WKWebView on macOS, WebKitGTK on Linux). You write UI in HTML/CSS/JS, logic in Amalgame, and a bidirectional IPC channel bridges the two. The package manifest targets Linux (Debian, Ubuntu): on macOS and Windows, the build options need adjusting.

Features

  • ✓System webview — no embedded Chromium
  • ✓JS → Amalgame calls with Window.Bind (JSON), Amalgame → JS with Eval
  • ✓Pages built in Amalgame (Element, Form) and form reading
  • ✓On Linux, WebKitGTK 4.1 must be installed (libwebkit2gtk-4.1-dev to build)
  • ✓Apache 2.0

Example

Minimal usage example — copy-paste runnable after install.

amc package add ui-web

import Amalgame.UI.Web

public class Program {
    public static void Main(string[] args) {
        let body: Element = Element.Stack()
            .AddChild(Element.Heading("Hello"))
            .AddChild(Element.Input("user").Attr("placeholder", "Your name"))
            .AddChild(Element.Button("Send")
                .OnClick((req: string) => req)
                .OnResult("out"))
            .AddChild(Element.Pre("").Id("out"))

        let f: Form = new Form("Demo", 640, 400)
        f.SetBody(body)
        Application.Run(f)
    }
}

At a glance

Related packages